Skip to content

Add social-share metadata and an Atom feed to the blog - #119

Closed
GuanzhouSong wants to merge 1 commit into
documentdb:mainfrom
GuanzhouSong:feat/blog-social-meta-rss
Closed

Add social-share metadata and an Atom feed to the blog#119
GuanzhouSong wants to merge 1 commit into
documentdb:mainfrom
GuanzhouSong:feat/blog-social-meta-rss

Conversation

@GuanzhouSong

Copy link
Copy Markdown
Contributor

Problem

blogs/_layouts/default.html ships only title, description, and theme-colorsharing 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/Twitter tags in the shared layout: og:type=article + article:published_time for dated posts, website elsewhere; the post's cover_image when present (absolute-ified via absolute_url), the site social card otherwise.
  • Atom feed at /blogs/feed.xml from a Liquid template, advertised via <link rel="alternate">. A template rather than the jekyll-feed plugin deliberately avoids touching Gemfile/Gemfile.lock (lockfile regeneration needs local bundler, and CI installs with the frozen lockfile).
  • site.url set to https://documentdb.io — required by absolute_url and the feed's permanent IDs.

Validation

  • The config's defaults apply layout: default to every file, so the feed explicitly sets layout: null — without this the XML would be wrapped in the HTML shell.
  • Cover-image handling mirrors the exact contains '://' branch already used by post-card.html and post.html.
  • The social card lives at the site root (outside the blog baseurl), so it's built from site.url directly; blog-relative cover images go through absolute_url (url + baseurl + path).
  • CI's build-validation job runs the full Jekyll build and fails on any Liquid error. Pairs with Serve the site at the domain root instead of /documentdb.github.io #106, which sets the deployed baseurl to /blogsmerge Serve the site at the domain root instead of /documentdb.github.io #106 first so og:url/feed IDs don't carry the repo-name prefix.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XGMeNSmhAgmqzkdc7cQQgf

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.
@GuanzhouSong

Copy link
Copy Markdown
Contributor Author

Combined into #120.

@GuanzhouSong
GuanzhouSong deleted the feat/blog-social-meta-rss branch July 30, 2026 16:46
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.

1 participant