From 658465e9127b5ebaf75fd8f28e0b9985b8869ea4 Mon Sep 17 00:00:00 2001 From: hamdy Date: Mon, 16 Nov 2020 14:51:31 +0200 Subject: [PATCH] searching --- gridsome.config.js | 6 +-- src/pages/Search.vue | 124 ++++++++++++++++++++++++++++++++++++++----- 2 files changed, 114 insertions(+), 16 deletions(-) diff --git a/gridsome.config.js b/gridsome.config.js index 007a1340d..8dbdc03ea 100644 --- a/gridsome.config.js +++ b/gridsome.config.js @@ -17,19 +17,19 @@ module.exports = { { typeName: 'Blog', indexName: 'Blog', - fields: ['name', 'title', 'rank', 'excerpt', 'image', 'path', 'datetime', 'author', 'pageInfo'] + fields: ['id', 'name', 'title', 'rank', 'excerpt', 'image', 'path', 'datetime', 'author', 'pageInfo'] }, { typeName: 'Project', indexName: 'Project', - fields: ['title', 'rank', 'excerpt', 'image', 'path', 'datetime', 'author', 'pageInfo'] + fields: ['id', 'title', 'rank', 'excerpt', 'image', 'path', 'datetime', 'author', 'pageInfo'] }, { typeName: 'Person', indexName: 'Person', - fields: ['name', 'rank', 'excerpt', 'image', 'path', 'bio', 'pageInfo'] + fields: ['id', 'name', 'rank', 'excerpt', 'image', 'path', 'bio', 'pageInfo'] }, ] } diff --git a/src/pages/Search.vue b/src/pages/Search.vue index cc6845d34..7e1d34c09 100644 --- a/src/pages/Search.vue +++ b/src/pages/Search.vue @@ -2,24 +2,99 @@
- + />
- -
+ + + +query { + projects: allProject { + edges { + node { + id + title + path + members { + id + name + image(width:64, height:64, fit:inside) + path + } + rank + linkedin + startDate : startdate(format:"MM YYYY") + humanTime : created(format:"DD MMMM YYYY") + datetime : created(format:"ddd MMM DD YYYY hh:mm:ss zZ") + status + excerpt + image(width:800) + path + timeToRead + author { + id + + image(width:64, height:64, fit:inside) + path + } + } + } + } + + people: allPerson { + edges { + node { + id + path + excerpt + content + name + rank + memberships + bio + linkedin + websites + project_ids + countries + cities + image(width:800) + private + } + } + } + + blogs: allBlog { + edges { + node { + id + name + title + team + rank + excerpt + image(width:800) + path + timeToRead + humanTime : created(format:"DD MMM YYYY") + datetime : created + author { + id + name + image(width:64, height:64, fit:inside) + path + } + } + } + } + +} + +