✨ feat: add support for social media cards #130
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a new
social_media_card
setting so that links shared on social media sites have an image preview. Like this:Changes
New
social_media_card
Setting:config.toml
, section front matter, and page front matter.page > section > config
.Cache Busting:
social_media_card
URLs to ensure social media sites fetch the latest image.Social Media Cards Added:
Documentation Updates:
config.toml
andtheme.toml
documentation with comments explaining the newsocial_media_card
setting.HTML Tag Fixes:
Macro Updates:
social_media_card
setting.How to automate the creation of social media cards
I created all the cards running one command. For those interested in how I automated the creation of the social media card images, check out my blog post: From Bashful to Social Butterfly: Automating Link Previews for Zola Sites. There I explain how I created the script I used to create these images (and automate their creation).
Example
Here's one of the automatically generated social media cards, which will be shown as a preview when the post is shared on social media (Telegram, LinkedIn, Mastodon, Twitter…):