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 og tags to site #77

Merged
merged 2 commits into from
Aug 15, 2024
Merged

fix: add og tags to site #77

merged 2 commits into from
Aug 15, 2024

Conversation

huijing
Copy link
Contributor

@huijing huijing commented Aug 14, 2024

Closes #76

This PR sets up the OG tags for /developers and allows more granular customisation at the individual blog post level.

@@ -2,6 +2,7 @@
layout: ../../layouts/BlogLayout.astro
title: "The Interledger Universe"
description: "Or: “What the heck are all those products and protocols?”"
ogImageUrl: /developers/img/blog/2024-08-13/og-image.png
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New frontmatter field that gets used in the BlogLayout template.

@@ -21,6 +24,12 @@ const { title, description } = Astro.props;
<meta name="viewport" content="width=device-width" />
<meta name="generator" content={Astro.generator} />
<title>{title ? `${title} | Interledger Foundation` : 'Interledger Foundation'}</title>

<meta property="og:title" content={title ? `${title} | Interledger Foundation` : 'Interledger Foundation'} />
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exposing ogType to the next layer down because I want individual blog posts to have type of article. Similar concept for the og-image.

@@ -10,7 +10,7 @@ const longDate = dateObj.toDateString().substring(4);
const rawHTMLString = `This article was originally published at <a href=${frontmatter.external_url}>${frontmatter.external_url}</a>.`
---

<BaseLayout title={frontmatter.title}>
<BaseLayout title={frontmatter.title} ogType="article" ogImageUrl={frontmatter.ogImageUrl ? new URL(frontmatter.ogImageUrl, Astro.site).href : new URL('/img/og-image.png', Astro.site).href}>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing props all the way like turtles (bad reference, oh well)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sabine requested the receiver move down toward the ZAR node.

@JoblersTune
Copy link
Contributor

Waiting for default OG image for engineering blog

@huijing huijing merged commit 234d717 into main Aug 15, 2024
1 check passed
@huijing huijing deleted the chj/76/add-og-tags branch August 15, 2024 10:33
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OG tags have not been set up on /developers
2 participants