Add social-share metadata and an Atom feed to the blog - #119
Closed
GuanzhouSong wants to merge 1 commit into
Closed
Conversation
The Jekyll layout's head had only title, description, and theme-color: sharing any blog post on X, LinkedIn, or Discord rendered a bare link with no card, and the blog had no feed for aggregators or readers. - og:/twitter: tags in the shared layout, using the post's cover image when present and the site social card otherwise, with og:type article on dated posts and website elsewhere. - A hand-rolled Atom feed at /blogs/feed.xml built from a Liquid template, advertised via a rel=alternate link. A template instead of jekyll-feed avoids a Gemfile.lock regeneration, which cannot be done on machines without local bundler access. - site.url is now set, which absolute_url and the feed's permanent entry IDs both require. The feed opts out of the site-wide layout default with layout: null; without it the config's defaults would wrap the XML in the HTML shell.
Contributor
Author
|
Combined into #120. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
blogs/_layouts/default.htmlships onlytitle,description, andtheme-color— sharing any blog post on X/LinkedIn/Discord renders a bare link with no card, which wastes announcement posts like the Kubernetes-operator launch. There's also no feed of any kind for aggregators and RSS readers.Fix
og:type=article+article:published_timefor dated posts,websiteelsewhere; the post'scover_imagewhen present (absolute-ified viaabsolute_url), the site social card otherwise./blogs/feed.xmlfrom a Liquid template, advertised via<link rel="alternate">. A template rather than thejekyll-feedplugin deliberately avoids touchingGemfile/Gemfile.lock(lockfile regeneration needs local bundler, and CI installs with the frozen lockfile).site.urlset tohttps://documentdb.io— required byabsolute_urland the feed's permanent IDs.Validation
defaultsapplylayout: defaultto every file, so the feed explicitly setslayout: null— without this the XML would be wrapped in the HTML shell.contains '://'branch already used bypost-card.htmlandpost.html.site.urldirectly; blog-relative cover images go throughabsolute_url(url + baseurl + path)./blogs— merge Serve the site at the domain root instead of /documentdb.github.io #106 first soog:url/feed IDs don't carry the repo-name prefix.🤖 Generated with Claude Code
https://claude.ai/code/session_01XGMeNSmhAgmqzkdc7cQQgf