-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
use dynamic og image for posts #33
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good to me!
If I'm interpreting correctly, you've very tactfully scoped these changes so that they're non-breaking, which is great. One small export-naming question (the main thing I could imagine "breaking" in the future), otherwise looks good to go!
src/og/index.js
Outdated
@@ -0,0 +1 @@ | |||
export { BlogPostOG, getBlogPostFonts } from './blog-post' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we set up the same thing for research commentary, could we just directly reuse getBlogPostFonts
? In that case should we call it something more generic, like getOGFonts()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah this had a smell to it. I coupled it like this in case other cards need more or less fonts, but it's clunky.
I've just refactored quite a bit to create a reusable font fetch function and to couple the fonts with the card component, so /blog doesn't need to import or deal with font fetching, but we can still configure exactly which fonts we need on a per-card basis (eg if research only uses 2/3 for example).
@@ -179,3 +153,28 @@ export const BlogPostOG = ({ title, date, authors, forceWrapAuthors }) => { | |||
</div> | |||
) | |||
} | |||
|
|||
export const getBlogPostCard = async ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice ✨
Required for completion of: carbonplan/blog#143