diff --git a/gridsome.server.js b/gridsome.server.js index 81d7c402469..61a717bf095 100644 --- a/gridsome.server.js +++ b/gridsome.server.js @@ -190,6 +190,23 @@ module.exports = function (api) { api.createPages(({createPage}) => { + + allPossiblePaths.forEach(node => { + + const path = node.path.substring(5); + + locales.forEach(locale => { + if (fs.existsSync(`docs/${locale}/${path.slice(0,-1)}.md`)) { + console.log('exists'); + } else { + createPage({ + path: `/docs/${locale}/${path}`, + component: './src/templates/AvailableTranslations.vue', + }) + } + }) + }) + createPage({ path: '/summary/:title', component: './src/templates/Summary.vue' diff --git a/src/templates/AvailableTranslations.vue b/src/templates/AvailableTranslations.vue new file mode 100644 index 00000000000..1ddb4cd7a34 --- /dev/null +++ b/src/templates/AvailableTranslations.vue @@ -0,0 +1,150 @@ + + + + + + + + + + This article has no translation for {{ $locale && $locale}}. Please see another available translations: + + + + + + + {{edge.node.title}} + + + + + + + + + + + + + + query { + + docs: allDocPage { + edges { + node { + title + description + path + } + } + } + + } + + + + + + \ No newline at end of file
+ This article has no translation for {{ $locale && $locale}}. Please see another available translations: +