Add sitemap

This commit is contained in:
Mikołaj Pich 2020-02-02 13:07:41 +01:00
parent 9c5819d832
commit f30e2b8839
6 changed files with 61 additions and 37 deletions

View file

@ -19,3 +19,4 @@ branches:
script:
- npm run lint
- npm run build
- npm run sitemap

9
package-lock.json generated
View file

@ -13584,6 +13584,15 @@
"resolved": "https://registry.npmjs.org/vue-async-computed/-/vue-async-computed-3.8.2.tgz",
"integrity": "sha512-If5roOhp/x0WWd0TWRD77YsuFoiIw3MbkcRlIB/FE3TqQCPje52eQp5CV5NN/7B0VAyPuGX5JQa+rc9AOcGAYw=="
},
"vue-cli-plugin-sitemap": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/vue-cli-plugin-sitemap/-/vue-cli-plugin-sitemap-1.0.4.tgz",
"integrity": "sha512-/4e6IVKFgrLUGoMiGubVvNJHl3OvCT710FhO7F75t7Xgzn1olzZ1jLVvk6S8KaHdT3Y0vQzImIp6hqmIfDyFxQ==",
"dev": true,
"requires": {
"ajv": "^6.10.2"
}
},
"vue-eslint-parser": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-7.0.0.tgz",

View file

@ -5,7 +5,8 @@
"scripts": {
"serve": "cross-env NODE_ENV=development webpack-dev-server --open --hot",
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules",
"lint": "vue-cli-service lint"
"lint": "vue-cli-service lint",
"sitemap": "vue-cli-service sitemap"
},
"dependencies": {
"@mdi/font": "^4.7.95",
@ -43,10 +44,11 @@
"raw-loader": "^4.0.0",
"sass-loader": "^8.0.0",
"style-loader": "^1.1.2",
"vue-template-compiler": "^2.6.11",
"webpack-cli": "^3.3.10",
"vue-cli-plugin-sitemap": "^1.0.4",
"vue-style-loader": "^4.1.2",
"webpack": "latest"
"vue-template-compiler": "^2.6.11",
"webpack": "latest",
"webpack-cli": "^3.3.10"
},
"gitHooks": {
"pre-commit": "lint-staged"

View file

@ -1,41 +1,10 @@
import Vue from 'vue';
import Router from 'vue-router';
import Home from './views/Home.vue';
const PrivacyPolicy = () => import(/* webpackChunkName: "privacy-policy" */ './views/PrivacyPolicy.vue');
const FAQ = () => import(/* webpackChunkName: "faq" */ './views/FAQ.vue');
import routes from './routes';
Vue.use(Router);
export default new Router({
mode: 'history',
routes: [
{
path: '/',
name: 'home',
component: Home,
},
{
path: '/polityka-prywatnosci',
name: 'polityka-prywatnosci',
component: PrivacyPolicy,
},
{
path: '/czesto-zadawane-pytania',
name: 'czesto-zadawane-pytania',
component: FAQ,
},
{
path: '/czesto-zadawane-pytania/:question_id',
component: FAQ,
},
{
path: '*.html',
redirect: (to) => to.params.pathMatch,
},
{
path: '*',
redirect: '/',
},
],
routes,
});

33
src/routes.js Normal file
View file

@ -0,0 +1,33 @@
const Home = () => import(/* webpackChunkName: "home" */ './views/Home.vue');
const PrivacyPolicy = () => import(/* webpackChunkName: "privacy-policy" */ './views/PrivacyPolicy.vue');
const FAQ = () => import(/* webpackChunkName: "faq" */ './views/FAQ.vue');
module.exports = [
{
path: '/',
name: 'home',
component: Home,
},
{
path: '/polityka-prywatnosci',
name: 'polityka-prywatnosci',
component: PrivacyPolicy,
},
{
path: '/czesto-zadawane-pytania',
name: 'czesto-zadawane-pytania',
component: FAQ,
},
{
path: '/czesto-zadawane-pytania/:question_id',
component: FAQ,
},
// {
// path: '*.html',
// redirect: (to) => to.params.pathMatch,
// },
{
path: '*',
redirect: '/',
},
];

View file

@ -1,5 +1,15 @@
const routes = require('./src/routes');
module.exports = {
publicPath: '/',
pluginOptions: {
sitemap: {
baseURL: 'https://wulkanowy.github.io',
outputDir: 'dist/',
pretty: true,
routes,
},
},
chainWebpack: (config) => {
config.module
.rule('md')