- Inserted Prerendering plugin('prerender-spa-plugin') to create HTML pages (for Google... crawler)
- Added Meta Tags (title, description and keywords)
This commit is contained in:
@@ -5,6 +5,8 @@ const helpers = require('./helpers');
|
|||||||
const webpack = require('webpack')
|
const webpack = require('webpack')
|
||||||
const envparser = require('./config/envparser')
|
const envparser = require('./config/envparser')
|
||||||
|
|
||||||
|
const PrerenderSPAPlugin = require('prerender-spa-plugin')
|
||||||
|
const Renderer = PrerenderSPAPlugin.PuppeteerRenderer
|
||||||
|
|
||||||
const extendTypescriptToWebpack = (config) => {
|
const extendTypescriptToWebpack = (config) => {
|
||||||
config.resolve
|
config.resolve
|
||||||
@@ -53,6 +55,30 @@ const extendHTMLToWebpack = (config) => {
|
|||||||
.loader('vue-html-loader')
|
.loader('vue-html-loader')
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const extendPrerender = (config) => {
|
||||||
|
config
|
||||||
|
.plugin('prerender-spa-plugin')
|
||||||
|
.use(PrerenderSPAPlugin, [{
|
||||||
|
// Required - The path to the webpack-outputted app to prerender.
|
||||||
|
staticDir: path.join(__dirname, 'dist/spa'),
|
||||||
|
// Required - Routes to render.
|
||||||
|
routes: ['/'],
|
||||||
|
|
||||||
|
renderer: new Renderer({
|
||||||
|
injectProperty: '__PRERENDER_INJECTED',
|
||||||
|
inject: {
|
||||||
|
foo: 'bar'
|
||||||
|
},
|
||||||
|
// renderAfterDocumentEvent: 'custom-post-render-event',
|
||||||
|
renderAfterTime: 5000,
|
||||||
|
// maxConcurrentRoutes: 4,
|
||||||
|
// renderAfterElementExists: '#content',
|
||||||
|
headless: true,
|
||||||
|
})
|
||||||
|
}])
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
module.exports = function (ctx) {
|
module.exports = function (ctx) {
|
||||||
return {
|
return {
|
||||||
htmlVariables: {
|
htmlVariables: {
|
||||||
@@ -109,6 +135,8 @@ module.exports = function (ctx) {
|
|||||||
.rule('template-engine')
|
.rule('template-engine')
|
||||||
.test(/\.(gql|graphql)$/)
|
.test(/\.(gql|graphql)$/)
|
||||||
.loader('graphql-tag/loader') */
|
.loader('graphql-tag/loader') */
|
||||||
|
|
||||||
|
// extendPrerender(config);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
dev: {
|
dev: {
|
||||||
|
|||||||
@@ -293,7 +293,6 @@ export default class CEventsCalendar extends MixinEvents {
|
|||||||
return (CalendarStore.state.intervalRange.max - CalendarStore.state.intervalRange.min) * (1 / CalendarStore.state.intervalRangeStep)
|
return (CalendarStore.state.intervalRange.max - CalendarStore.state.intervalRange.min) * (1 / CalendarStore.state.intervalRangeStep)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
get containerStyle() {
|
get containerStyle() {
|
||||||
const styles = { height: '' }
|
const styles = { height: '' }
|
||||||
if (this.calendarView !== 'month' || (this.calendarView === 'month' && CalendarStore.state.dayHeight === 0)) {
|
if (this.calendarView !== 'month' || (this.calendarView === 'month' && CalendarStore.state.dayHeight === 0)) {
|
||||||
|
|||||||
14
src/mixins/mixin-metatags.ts
Normal file
14
src/mixins/mixin-metatags.ts
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import Vue from 'vue'
|
||||||
|
import Component from 'vue-class-component'
|
||||||
|
import { IMetaTags } from '@src/model'
|
||||||
|
import { tools } from '@src/store/Modules/tools'
|
||||||
|
|
||||||
|
// You can declare a mixin as the same style as components.
|
||||||
|
@Component
|
||||||
|
export default class MixinMetaTags extends Vue {
|
||||||
|
public mymeta: IMetaTags = {title: '', description: '', keywords: ''}
|
||||||
|
|
||||||
|
public setmeta(mymeta: IMetaTags) {
|
||||||
|
this.mymeta = mymeta
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user