Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 4 additions & 18 deletions pages/archive/[slug].js
Original file line number Diff line number Diff line change
Expand Up @@ -85,25 +85,11 @@ const EventPage = (props) => {
export default EventPage

export const getStaticPaths = async () => {
const countResult = await client.request({
query: `{ archiveConnection { totalCount } }`,
})
const totalCount = countResult.data.archiveConnection.totalCount
const length = await client.queries.archiveConnection()
const postCount = length.data.archiveConnection.totalCount

const {data} = await client.request({
query: `
query getPaths($count: Float) {
archiveConnection(last: $count, before: "cG9zdCNkYXRlIzE2NTc4Njg0MDAwMDAjY29udGVudC9wb3N0cy9hbm90aGVyUG9zdC5qc29u") {
edges {
node {
_sys {
filename
}
}
}
}
}`,
variables: {count: totalCount},
const {data} = await client.queries.archiveConnection({
last: postCount,
})

const paths = data.archiveConnection.edges.map((x) => {
Expand Down
2 changes: 1 addition & 1 deletion pages/archive/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export const getStaticProps = async () => {
const {data} = await client.request({
query: `
{
archiveConnection(filter: {categories: {category: {category: {title: {eq: "Event"}}}}}, sort: "published", last:30, before: "cG9zdCNkYXRlIzE2NTc4Njg0MDAwMDAjY29udGVudC9wb3N0cy9hbm90aGVyUG9zdC5qc29u") {
archiveConnection(filter: {categories: {category: {category: {title: {eq: "Event"}}}}}, sort: "published", last:30) {
edges {
node {
id
Expand Down
2 changes: 1 addition & 1 deletion pages/archive/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export const getStaticProps = async () => {
query: `
query getContent($eventCount: Float, $endOfWeek: String)
{
archiveConnection(filter: {published: {before: $endOfWeek}}, sort: "published", last: $eventCount, before: "cG9zdCNkYXRlIzE2NTc4Njg0MDAwMDAjY29udGVudC9wb3N0cy9hbm90aGVyUG9zdC5qc29u"){
archiveConnection(filter: {published: {before: $endOfWeek}}, sort: "published", last: $eventCount){
edges {
node {
id
Expand Down
2 changes: 1 addition & 1 deletion pages/archive/specialty-shows/[slug].js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export const getStaticProps = async (ctx) => {
const {data} = await client.request({
query: `
query getContent($title: String, $endOfWeek: String) {
archiveConnection(filter: {categories: {category: {category: {title: {eq: $title}}}}, published: {before: $endOfWeek}}, sort: "published", last: 30, before: "cG9zdCNkYXRlIzE2NTc4Njg0MDAwMDAjY29udGVudC9wb3N0cy9hbm90aGVyUG9zdC5qc29u") {
archiveConnection(filter: {categories: {category: {category: {title: {eq: $title}}}}, published: {before: $endOfWeek}}, sort: "published", last: 100) {
edges {
node {
id
Expand Down
2 changes: 1 addition & 1 deletion pages/archive/specialty-shows/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export const getStaticProps = async () => {
query: `
query getContent($endOfWeek:String, $eventCount: Float)
{
archiveConnection(filter: {categories: {category: {category: {title: {eq: "Specialty Show"}}}}, published: {before: $endOfWeek}}, sort: "published", last:$eventCount, before: "cG9zdCNkYXRlIzE2NTc4Njg0MDAwMDAjY29udGVudC9wb3N0cy9hbm90aGVyUG9zdC5qc29u") {
archiveConnection(filter: {categories: {category: {category: {title: {eq: "Specialty Show"}}}}, published: {before: $endOfWeek}}, sort: "published", last:$eventCount) {
edges {
node {
id
Expand Down
2 changes: 1 addition & 1 deletion pages/blog/category/[slug].js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const getStaticProps = async (ctx) => {
const {data} = await client.request({
query: `
query getContent($title: String) {
blogConnection(filter: {categories: {category: {category: {title: {eq: $title}}}}}, sort: "published", last:30, before: "cG9zdCNkYXRlIzE2NTc4Njg0MDAwMDAjY29udGVudC9wb3N0cy9hbm90aGVyUG9zdC5qc29u") {
blogConnection(filter: {categories: {category: {category: {title: {eq: $title}}}}}, sort: "published", last:30) {
edges {
node {
id
Expand Down
2 changes: 1 addition & 1 deletion pages/blog/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export const getStaticProps = async () => {
query: `
query getContent($postCount: Float)
{
blogConnection(sort: "published", last: $postCount, before: "cG9zdCNkYXRlIzE2NTc4Njg0MDAwMDAjY29udGVudC9wb3N0cy9hbm90aGVyUG9zdC5qc29u"){
blogConnection(sort: "published", last: $postCount){
edges {
node {
id
Expand Down
4 changes: 2 additions & 2 deletions pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export const getStaticProps = async () => {
query: `
query getContent($startOfWeek: String, $endOfWeek: String)
{
blogConnection(sort: "published", last:6, before: "cG9zdCNkYXRlIzE2NTc4Njg0MDAwMDAjY29udGVudC9wb3N0cy9hbm90aGVyUG9zdC5qc29u"){
blogConnection(sort: "published", last:6){
edges {
node {
id
Expand All @@ -119,7 +119,7 @@ export const getStaticProps = async () => {
}
},

archiveConnection(filter: {published: {after: $startOfWeek, before: $endOfWeek}}, sort: "published", last:30, before: "cG9zdCNkYXRlIzE2NTc4Njg0MDAwMDAjY29udGVudC9wb3N0cy9hbm90aGVyUG9zdC5qc29u") {
archiveConnection(filter: {published: {after: $startOfWeek, before: $endOfWeek}}, sort: "published", last:30) {
edges {
node {
id
Expand Down
Loading