Add filter

This commit is contained in:
samaradel
2021-02-22 12:06:33 +02:00
parent d1b3744acf
commit 7350ccdb89
8 changed files with 97 additions and 94 deletions

View File

@@ -100,9 +100,9 @@ module.exports = function(api) {
});
api.createPages(async ({ graphql, createPage }) => {
api.createPages(async({ graphql, createPage }) => {
const { data } = await graphql(`{
allProjectTag(filter: { title: {in: ["farming"]}}) {
allProjectTag(filter: { title: {in: ["tech", "foundation"]}}) {
edges {
node {
id
@@ -124,7 +124,7 @@ module.exports = function(api) {
})
})
api.createPages(async ({ graphql, createPage }) => {
api.createPages(async({ graphql, createPage }) => {
const { data } = await graphql(`{
allBlogTag {
edges {
@@ -148,7 +148,7 @@ module.exports = function(api) {
})
})
api.createPages(async ({ graphql, createPage }) => {
api.createPages(async({ graphql, createPage }) => {
const { data } = await graphql(`{
allNewsTag {
edges {
@@ -180,9 +180,9 @@ module.exports = function(api) {
private: private
}
})
})
})
api.createPages(({ createPage }) => {
api.createPages(({ createPage }) => {
createPage({
path: '/team',
component: './src/templates/Team.vue',
@@ -190,9 +190,9 @@ api.createPages(({ createPage }) => {
private: private
}
})
});
});
api.createPages(({ createPage }) => {
api.createPages(({ createPage }) => {
createPage({
path: '/search',
component: './src/templates/Search.vue',
@@ -200,7 +200,7 @@ api.createPages(({ createPage }) => {
private: private
}
})
});
});
}

View File

@@ -36,7 +36,7 @@
<page-query>
query($page: Int){
entries: allBlog(perPage: 10, page: $page, sortBy: "created", order: DESC, filter: {category: { id: {in: ["farming"]}}}) @paginate{
entries: allBlog(perPage: 10, page: $page, sortBy: "created", order: DESC, filter: {category: { id: {in: ["tech", "foundation"]}}}) @paginate{
totalCount
pageInfo {
totalPages

View File

@@ -40,7 +40,7 @@
<page-query>
query($page: Int){
entries: allNews(perPage: 10, page: $page, sortBy: "created", order: DESC, filter: {category: { id: {in: ["farming"]}}}) @paginate{
entries: allNews(perPage: 10, page: $page, sortBy: "created", order: DESC, filter: {category: { id: {in: ["tech", "foundation"]}}}) @paginate{
totalCount
pageInfo {
totalPages
@@ -67,7 +67,7 @@ query($page: Int){
}
}
topics: allNewsTag{
topics: allNewsTag {
edges{
node{
title

View File

@@ -16,7 +16,7 @@
<page-query>
query ($private: Int){
entries: allProject (sortBy: "rank", order: DESC, filter: { private: { ne: $private }, tags: { id: {in: ["farming"]}}}){
entries: allProject (sortBy: "rank", order: DESC, filter: { private: { ne: $private }, tags: { id: {in: ["tech", "foundation"]}}}){
totalCount
edges {
node {
@@ -39,7 +39,7 @@ query ($private: Int){
}
}
tags: allProjectTag (filter: { title: {in: ["farming"]}}) {
tags: allProjectTag (filter: { title: {in: ["tech", "foundation"]}}) {
edges{
node{
id
@@ -70,5 +70,8 @@ export default {
return res;
},
},
mounted(){
console.log(this.$page)
}
};
</script>

View File

@@ -136,7 +136,7 @@
}
}
tags: allProjectTag (filter: { title: {in: ["farming"]}}) {
tags: allProjectTag (filter: { title: {in: ["tech", "foundation"]}}) {
edges{
node{
id

View File

@@ -18,7 +18,7 @@
<page-query>
query ($private: Int){
entries: allProject (sortBy: "rank", order: DESC, filter: { private: { ne: $private }}){
entries: allProject (sortBy: "rank", order: DESC, filter: { private: { ne: $private }}, tags: { id: {in: ["tech", "foundation"]}}){
totalCount
edges {
node {

View File

@@ -30,7 +30,7 @@
<page-query>
query ($private: Int){
projects: allProject (filter: { private: { ne: $private }, tags: { id: {in: ["farming"]}}}){
projects: allProject (filter: { private: { ne: $private }, tags: { id: {in: ["tech", "foundation"]}}}){
edges {
node {
id

View File

@@ -130,7 +130,7 @@
}
}
allProjectTag(filter: { title: {in: ["farming"]}}){
allProjectTag(filter: { title: {in: ["tech", "foundation"]}}){
edges{
node{
id