Add filters

This commit is contained in:
samaradel
2021-04-01 13:52:21 +02:00
parent 17939dbd49
commit f177b95f1e
7 changed files with 28 additions and 24 deletions

View File

@@ -102,8 +102,8 @@ module.exports = function(api) {
api.createPages(async({ graphql, createPage }) => { api.createPages(async({ graphql, createPage }) => {
const { data } = await graphql(`{ const { data } = await graphql(`{
allProjectTag(filter: { title: {in: ["foundation"]}}) { allProjectTag(filter: { title: {in: ["blockchain", "experience", "technology", "farming", "community", "infrastructure", "impact"]}}) {
edges { edges {
node { node {
id id
path path

View File

@@ -36,7 +36,7 @@
<page-query> <page-query>
query($page: Int){ query($page: Int){
entries: allBlog(perPage: 10, page: $page, sortBy: "created", order: DESC, filter: {category: { id: {in: ["tech", "foundation"]}}}) @paginate{ entries: allBlog(perPage: 10, page: $page, sortBy: "created", order: DESC, filter: {category: { id: {in: ["blockchain", "experience", "technology", "farming", "community", "infrastructure", "impact"]}}}) @paginate{
totalCount totalCount
pageInfo { pageInfo {
totalPages totalPages
@@ -69,7 +69,7 @@ query($page: Int){
} }
} }
topics: allBlogTag{ topics: allBlogTag(filter: { title: {in: ["blockchain", "experience", "technology", "farming", "community", "infrastructure", "impact"]}}) {
edges{ edges{
node{ node{
title title

View File

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

View File

@@ -1,10 +1,14 @@
<template> <template>
<Layout :hideHeader="true" :disableScroll="true"> <Layout :hideHeader="true" :disableScroll="true">
<TagFilterHeader :tags="memberships" :selected="$page.membership.title" v-if="$page.allMembership.edges.length > 1"/> <TagFilterHeader
:tags="memberships"
:selected="$page.membership.title"
v-if="$page.allMembership.edges.length > 1"
/>
<div class="container sm:pxi-0 mx-auto mt-8 overflow-x-hidden"> <div class="container sm:pxi-0 mx-auto mt-8 overflow-x-hidden">
<div class="mx-4 sm:mx-0"> <div class="mx-4 sm:mx-0">
<h1 class="pb-0 mb-0 text-5xl font-medium capitalize"> <h1 class="pb-0 mb-0 text-5xl font-medium capitalize">
{{ $page.membership.title }} {{ $page.membership.title.replace("_", " ") }}
</h1> </h1>
<p class="text-gray-700 text-xl"> <p class="text-gray-700 text-xl">
<span class="self-center" <span class="self-center"
@@ -59,7 +63,7 @@
} }
} }
allMembership(filter: {title: {in: ["foundation", "tech"]}}){ allMembership(filter: {title: {in: ["cofounders", "tech", "foundation", "ambassadors", "matchmakers", "farmers", "aci_members", "partners", "wisdom_council", "technology_council", "grid_guardians"]}}){
edges{ edges{
node{ node{
id id

View File

@@ -39,7 +39,7 @@ query ($private: Int){
} }
} }
tags: allProjectTag (filter: { title: {in: ["foundation"]}}) { tags: allProjectTag (filter: { title: {in: ["blockchain", "experience", "technology", "farming", "community", "infrastructure", "impact"]}}) {
edges{ edges{
node{ node{
id id

View File

@@ -129,7 +129,7 @@
} }
} }
allProjectTag(filter: { title: {in: ["tech", "foundation"]}}){ allProjectTag(filter: { title: {in: ["blockchain", "experience", "technology", "farming", "community", "infrastructure", "impact"]}}){
edges{ edges{
node{ node{
id id
@@ -139,7 +139,7 @@
} }
} }
allNewsTag{ allNewsTag(filter: { title: {in: ["blockchain", "experience", "technology", "farming", "community", "infrastructure", "impact"]}}){
edges{ edges{
node{ node{
id id
@@ -149,7 +149,7 @@
} }
} }
allBlogTag{ allBlogTag(filter: { title: {in: ["blockchain", "experience", "technology", "farming", "community", "infrastructure", "impact"]}}){
edges{ edges{
node{ node{
id id

View File

@@ -1,6 +1,6 @@
<template> <template>
<Layout> <Layout>
<!-- <TagFilterHeader :tags="memberships" selected="all" v-if="$page.memberships.edges.length > 1"/> --> <TagFilterHeader :tags="memberships" selected="all" v-if="$page.memberships.edges.length > 1"/>
<div class="container sm:pxi-0 mx-auto mt-8 overflow-x-hidden"> <div class="container sm:pxi-0 mx-auto mt-8 overflow-x-hidden">
<div class="flex flex-wrap with-large pt-8 pb-8 mx-4 sm:-mx-4"> <div class="flex flex-wrap with-large pt-8 pb-8 mx-4 sm:-mx-4">
<PostListItem <PostListItem
@@ -15,7 +15,7 @@
<page-query> <page-query>
query ($private: Int){ query ($private: Int){
entries: allPerson (sortBy: "rank", order: DESC, filter: { private: { ne: $private }}){ entries: allPerson (sortBy: "rank", order: DESC, filter: { private: { ne: $private }, memberships: { id: {in: ["cofounders", "tech", "foundation", "ambassadors", "matchmakers", "farmers", "aci_members", "partners", "wisdom_council", "technology_council", "grid_guardians"]}}}){
totalCount totalCount
edges { edges {
node { node {
@@ -35,15 +35,15 @@ query ($private: Int){
} }
} }
# memberships: allMembership(filter: {title: {in: ["foundation", "tech"]}}){ memberships: allMembership(filter: {title: {in:["cofounders", "tech", "foundation", "ambassadors", "matchmakers", "farmers", "aci_members", "partners", "wisdom_council", "technology_council", "grid_guardians"]}}){
# edges{ edges{
# node{ node{
# id id
# title title
# path path
# } }
# } }
# } }
} }
</page-query> </page-query>