diff --git a/content/author/christine.md b/content/author/christine.md index a7afe7d38..b26cb3245 100644 --- a/content/author/christine.md +++ b/content/author/christine.md @@ -1,6 +1,7 @@ --- id: christine name: Christine +category: team bio: Primis vitae mauris turpis ornare libero odio torquent vehicula proin consequat curabitur mattis facebook: https://www.facebook.com twitter: https://www.twitter.com diff --git a/content/author/kristof.md b/content/author/kristof.md index 024b412ef..899c0785d 100644 --- a/content/author/kristof.md +++ b/content/author/kristof.md @@ -1,6 +1,7 @@ --- id: kristof name: kds +category: team bio: Primis vitae mauris turpis ornare libero odio torquent vehicula proin consequat curabitur mattis facebook: https://www.facebook.com twitter: https://www.twitter.com diff --git a/gridsome.config.js b/gridsome.config.js index 162b5f2a2..cf200ab74 100644 --- a/gridsome.config.js +++ b/gridsome.config.js @@ -34,7 +34,13 @@ module.exports = { use: '@gridsome/source-filesystem', options: { typeName: 'Author', - path: './content/author/*.md' + path: './content/author/*.md', + refs: { + category: { + typeName: 'Category', + create: true + } + } } }, { diff --git a/src/templates/Author.vue b/src/templates/Author.vue index 6baa23f5a..5717c7f78 100644 --- a/src/templates/Author.vue +++ b/src/templates/Author.vue @@ -10,6 +10,14 @@

{{ $page.author.name }}

+
+ + {{ $page.author.category.title }} + +

{{ $page.author.bio }}

{{ $page.author.belongsTo.totalCount }} Projects @@ -77,6 +85,22 @@ query($id: ID!, $page:Int) { author(id: $id) { name + category { + id + title + path + belongsTo(limit:4) { + totalCount + edges { + node { + ... on Blog { + title + path + } + } + } + } + } path bio image(width:150, height:150) @@ -103,6 +127,7 @@ category { id title + path } author { id diff --git a/src/templates/Category.vue b/src/templates/Category.vue index 5e07b2569..ee5c02538 100644 --- a/src/templates/Category.vue +++ b/src/templates/Category.vue @@ -70,6 +70,25 @@ } } } + + node { + ... on Author { + name + path + bio + bio + image(width:150, height:150) + facebook + twitter + linkedin + content + category { + id + title + } + + } + } } } }