Skip to content

Commit

Permalink
Merge pull request #1000 from varianter/mikael/fix-seo
Browse files Browse the repository at this point in the history
fix: seo and fallback seo/opengraph settings
  • Loading branch information
mikaelbr authored Dec 12, 2024
2 parents 64e383e + 392640e commit 6351c01
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/utils/seo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ export async function generateMetadataFromSeo(
);

const title =
seo?.title ||
defaultSeo?.seo?.title ||
companyInfo?.companyName ||
seo?.title ??
defaultSeo?.seo?.title ??
companyInfo?.companyName ??
"Variant";
const description = seo?.description || defaultSeo?.seo?.description;
const keywords = seo?.keywords || "";
const description = seo?.description ?? defaultSeo?.seo?.description;
const keywords = seo?.keywords ?? "";

const favicon = brandAssets?.favicon;
const faviconUrl = favicon ? urlFor(favicon).url() : "";
Expand Down
2 changes: 1 addition & 1 deletion studio/lib/queries/pages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const SECTIONS_FRAGMENT = groq`
`;

export const SEO_FRAGMENT = groq`
"seo": ${translatedFieldFragment("seo")} {
"seo": seo{
"title": seoTitle,
"description": seoDescription,
"imageUrl": seoImage.asset->url,
Expand Down

0 comments on commit 6351c01

Please sign in to comment.