diff --git a/lib/app/dataMixin.js b/lib/app/dataMixin.js index 5b249b4589..4684cf7ca2 100644 --- a/lib/app/dataMixin.js +++ b/lib/app/dataMixin.js @@ -80,5 +80,12 @@ export default { this.$route.path ) } + }, + created () { + if (this.$ssrContext) { + this.$ssrContext.title = this.$title + this.$ssrContext.lang = this.$lang + this.$ssrContext.description = this.$page.description || this.$description + } } } diff --git a/lib/app/util.js b/lib/app/util.js index 29643be49f..e1229ad1d8 100644 --- a/lib/app/util.js +++ b/lib/app/util.js @@ -13,4 +13,8 @@ export function findPageForPath (pages, path) { return page } } + return { + path: '', + frontmatter: {} + } } diff --git a/lib/default-theme/Layout.vue b/lib/default-theme/Layout.vue index df988d69d7..ff7961bc68 100644 --- a/lib/default-theme/Layout.vue +++ b/lib/default-theme/Layout.vue @@ -87,14 +87,6 @@ export default { } }, - created () { - if (this.$ssrContext) { - this.$ssrContext.title = this.$title - this.$ssrContext.lang = this.$lang - this.$ssrContext.description = this.$page.description || this.$description - } - }, - mounted () { // update title / meta tags this.currentMetaTags = []