Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add absolute path to frontmatter meta og:image (cohere) #1223

Merged
merged 10 commits into from
Jul 31, 2024
Prev Previous commit
Next Next commit
merge from main
RohinBhargava committed Jul 30, 2024
commit b4e732f1d9e5e9219860ca15223cd005cdd7aaf6
16 changes: 10 additions & 6 deletions packages/ui/app/src/next-app/utils/getSeoProp.ts
Original file line number Diff line number Diff line change
@@ -64,12 +64,16 @@ export function getSeoProps(
const { data: frontmatter } = getFrontmatter(page.markdown);
ogMetadata = { ...ogMetadata, ...frontmatter };

// retrofit og:image
if (frontmatter.image != null) {
ogMetadata["og:image"] ??= {
type: "url",
value: FernNavigation.utils.convertRelativeToAbsoluteUrl(domain, node.slug, frontmatter.image),
};
// retrofit og:image
if (frontmatter.image != null) {
ogMetadata["og:image"] ??= {
type: "url",
value: FernNavigation.utils.convertRelativeToAbsoluteUrl(domain, node.slug, frontmatter.image),
};
}

seo.title ??= frontmatter.title;
seo.description ??= frontmatter.description ?? frontmatter.subtitle ?? frontmatter.excerpt;
}
}

You are viewing a condensed version of this merge commit. You can view the full changes here.