mirror of
https://github.com/katanemo/plano.git
synced 2026-06-29 15:49:40 +02:00
fix(web): refresh blog content and featured post selection (#862)
This commit is contained in:
parent
39b430d74b
commit
76ff353c1e
2 changed files with 45 additions and 6 deletions
|
|
@ -2,9 +2,15 @@ import { createClient } from "@sanity/client";
|
|||
import imageUrlBuilder from "@sanity/image-url";
|
||||
import type { SanityImageSource } from "@sanity/image-url/lib/types/types";
|
||||
|
||||
const projectId = process.env.NEXT_PUBLIC_SANITY_PROJECT_ID;
|
||||
const dataset = process.env.NEXT_PUBLIC_SANITY_DATASET;
|
||||
const apiVersion = process.env.NEXT_PUBLIC_SANITY_API_VERSION;
|
||||
const projectId =
|
||||
process.env.NEXT_PUBLIC_SANITY_PROJECT_ID ||
|
||||
"71ny25bn";
|
||||
const dataset =
|
||||
process.env.NEXT_PUBLIC_SANITY_DATASET ||
|
||||
"production";
|
||||
const apiVersion =
|
||||
process.env.NEXT_PUBLIC_SANITY_API_VERSION ||
|
||||
"2025-01-01";
|
||||
|
||||
export const hasSanityConfig = Boolean(projectId && dataset && apiVersion);
|
||||
|
||||
|
|
@ -13,7 +19,8 @@ export const client = hasSanityConfig
|
|||
projectId,
|
||||
dataset,
|
||||
apiVersion,
|
||||
useCdn: true, // Set to false if statically generating pages, using ISR or using the on-demand revalidation API
|
||||
// Keep blog/admin updates visible immediately after publishing.
|
||||
useCdn: false,
|
||||
})
|
||||
: null;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue