diff --git a/content/site/navigation.json b/content/site/navigation.json index 8a376eb4b..b80df76b3 100644 --- a/content/site/navigation.json +++ b/content/site/navigation.json @@ -5,15 +5,21 @@ "link": "/", "external": false }, - { - "name": "Values", - "link": "/about", - "external": false - }, + { "name": "Projects", "link": "/projects", "external": false + }, + { + "name": "People", + "link": "/people", + "external": false + }, + { + "name": "Values", + "link": "/about", + "external": false } ], "footerNavigation": [{ diff --git a/gridsome.config.js b/gridsome.config.js index 59e049b5b..18b2ef133 100644 --- a/gridsome.config.js +++ b/gridsome.config.js @@ -96,7 +96,7 @@ module.exports = { path: '/blog/:id' }], Person: [{ - path: '/author/:id', + path: '/people/:id', component: '~/templates/Person.vue' }], Tag: [{ diff --git a/gridsome.server.js b/gridsome.server.js index a70dfad48..f14ef4f8d 100644 --- a/gridsome.server.js +++ b/gridsome.server.js @@ -38,6 +38,15 @@ module.exports = function (api) { ...options }; } + + + if (options.internal.typeName === 'Person') { + options.countries = (typeof options.countries === 'string') ? options.countries.split(',').map(string => string.trim()) : options.countries; + options.cities = (typeof options.cities === 'string') ? options.cities.split(',').map(string => string.trim()) : options.cities; + return { + ...options + }; + } }) api.createPages(async ({ diff --git a/src/pages/People.vue b/src/pages/People.vue new file mode 100644 index 000000000..a3b2c942d --- /dev/null +++ b/src/pages/People.vue @@ -0,0 +1,54 @@ + + + + +query($page:Int) { + entries: allPerson(perPage: 40, page: $page) @paginate { + totalCount + pageInfo { + totalPages + currentPage + } + edges { + node { + path + content + name + rank + memberships + bio + linkedin + websites + project_ids + countries + cities + image(width:800) + private + } + } + } +} + + + + diff --git a/src/templates/Person.vue b/src/templates/Person.vue index 26bc5d828..c913ad6ac 100644 --- a/src/templates/Person.vue +++ b/src/templates/Person.vue @@ -77,13 +77,20 @@ query($id: ID!, $page:Int) { person(id: $id) { - name - path - bio - image(width:150, height:150) - linkedin - content - belongsTo(perPage: 5, page: $page) @paginate { + path + content + name + rank + memberships + bio + linkedin + websites + project_ids + countries + cities + private + image(width:150, height:150) + belongsTo(perPage: 5, page: $page) @paginate { totalCount pageInfo { totalPages diff --git a/src/templates/User.vue b/src/templates/User.vue deleted file mode 100644 index b90afb273..000000000 --- a/src/templates/User.vue +++ /dev/null @@ -1,139 +0,0 @@ - - - - query($id: ID!, $page:Int) { - user(id: $id) { - name - path - bio - image(width:150, height:150) - facebook - twitter - linkedin - content - belongsTo(perPage: 5, page: $page) @paginate { - totalCount - pageInfo { - totalPages - currentPage - } - edges { - node { - ... on Blog { - title - excerpt - image(width:800) - path - timeToRead - humanTime : created(format:"DD MMM YYYY") - datetime : created - user { - id - name - image(width:64, height:64, fit:inside) - path - } - } - } - } - } - } - } - - -