mirror of
https://github.com/katanemo/plano.git
synced 2026-06-23 15:38:07 +02:00
feat(web): merge DigitalOcean release announcement updates (#860)
* feat(web): announce DigitalOcean acquisition across sites * fix(web): make blog routes resilient without Sanity config * fix(web): add mobile arrow cue to announcement banner * fix(web): point acquisition links to announcement post
This commit is contained in:
parent
0857cfafbf
commit
39b430d74b
15 changed files with 3156 additions and 701 deletions
|
|
@ -6,15 +6,22 @@ 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;
|
||||
|
||||
export const client = createClient({
|
||||
projectId,
|
||||
dataset,
|
||||
apiVersion,
|
||||
useCdn: true, // Set to false if statically generating pages, using ISR or using the on-demand revalidation API
|
||||
});
|
||||
export const hasSanityConfig = Boolean(projectId && dataset && apiVersion);
|
||||
|
||||
const builder = imageUrlBuilder(client);
|
||||
export const client = hasSanityConfig
|
||||
? createClient({
|
||||
projectId,
|
||||
dataset,
|
||||
apiVersion,
|
||||
useCdn: true, // Set to false if statically generating pages, using ISR or using the on-demand revalidation API
|
||||
})
|
||||
: null;
|
||||
|
||||
const builder = client ? imageUrlBuilder(client) : null;
|
||||
|
||||
export function urlFor(source: SanityImageSource) {
|
||||
if (!builder) {
|
||||
throw new Error("Sanity client is not configured.");
|
||||
}
|
||||
return builder.image(source);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue