diff --git a/content/page/one.md b/content/page/one.md new file mode 100644 index 000000000..19e0fe54f --- /dev/null +++ b/content/page/one.md @@ -0,0 +1,7 @@ +--- +id: one +title: One +--- + + +# Hi \ No newline at end of file diff --git a/gridsome.config.js b/gridsome.config.js index 0f8f1557a..b4e619895 100644 --- a/gridsome.config.js +++ b/gridsome.config.js @@ -55,6 +55,13 @@ module.exports = { path: 'content/site/*.json' } }, + { + use: '@gridsome/source-filesystem', + options: { + typeName: 'MarkdownPage', + path: './content/page/**/*.md', + } + }, { use: '@gridsome/source-filesystem', options: { @@ -143,5 +150,9 @@ module.exports = { path: '/project/:id', component: '~/templates/Project.vue' }], + MarkdownPage: [{ + path: '/page/:id', + component: '~/templates/MarkdownPage.vue' + }], } } \ No newline at end of file diff --git a/src/templates/MarkdownPage.vue b/src/templates/MarkdownPage.vue new file mode 100644 index 000000000..6a598e972 --- /dev/null +++ b/src/templates/MarkdownPage.vue @@ -0,0 +1,41 @@ + + + + query($id: ID!) { + markdownPage(id: $id) { + path + content + title + } + } + + + + + >