Template support for OpenGraph/Twitter preview metadata in generated Slugkit sites #219

Closed
opened 2026-06-27 21:49:48 -05:00 by erik · 2 comments
Owner

Problem

Slugkit-compatible generated sites need first-class support for rich link previews. The slugkit.com site exposed the gap: published article pages rendered content correctly, but Mastodon did not show a proper preview because post detail pages lacked OpenGraph/Twitter card metadata.

Reference production article:

https://slugkit.com/posts/slug-cli-init

Missing metadata included:

  • og:title
  • og:description
  • og:url
  • og:type
  • og:image
  • twitter:card

Expected

The Slugkit template/framework should make it straightforward for generated sites to emit correct social preview metadata for post/article detail pages.

Scope

  • Inspect how the core/template public layout builds <head> metadata.
  • Add or document reusable helpers/patterns for post preview metadata.
  • Ensure generated sites can emit absolute OpenGraph/Twitter card tags for posts.
  • Prefer post media/banner/first image for preview images where supported.
  • Include safe fallbacks when no image is available.
  • Coordinate expectations with slugkit.com implementation if needed.

Acceptance criteria

  • Generated/template post detail pages can emit og:title, og:description, og:url, og:type, and image metadata where available.
  • Twitter card metadata is supported, including summary_large_image for image-backed posts.
  • Preview image URLs are absolute and reachable when generated.
  • Existing page title/description/canonical behavior remains compatible.
  • Tests or template snapshots cover preview metadata behavior.
  • Documentation notes crawler cache behavior, especially Mastodon preview caching.
## Problem Slugkit-compatible generated sites need first-class support for rich link previews. The slugkit.com site exposed the gap: published article pages rendered content correctly, but Mastodon did not show a proper preview because post detail pages lacked OpenGraph/Twitter card metadata. Reference production article: `https://slugkit.com/posts/slug-cli-init` Missing metadata included: - `og:title` - `og:description` - `og:url` - `og:type` - `og:image` - `twitter:card` ## Expected The Slugkit template/framework should make it straightforward for generated sites to emit correct social preview metadata for post/article detail pages. ## Scope - Inspect how the core/template public layout builds `<head>` metadata. - Add or document reusable helpers/patterns for post preview metadata. - Ensure generated sites can emit absolute OpenGraph/Twitter card tags for posts. - Prefer post media/banner/first image for preview images where supported. - Include safe fallbacks when no image is available. - Coordinate expectations with slugkit.com implementation if needed. ## Acceptance criteria - Generated/template post detail pages can emit `og:title`, `og:description`, `og:url`, `og:type`, and image metadata where available. - Twitter card metadata is supported, including `summary_large_image` for image-backed posts. - Preview image URLs are absolute and reachable when generated. - Existing page title/description/canonical behavior remains compatible. - Tests or template snapshots cover preview metadata behavior. - Documentation notes crawler cache behavior, especially Mastodon preview caching.
Author
Owner

Synced from todu comment by @todu on 2026-06-28T12:39:59.227Z

Closing summary

  • PR #225 was merged into main.
  • Local main is aligned with origin/main at merge commit c0ade04.
  • Prior review recorded Forgejo CI passing, approval, and acceptance criteria 6/6 met.

Acceptance criteria verified:

  • Generated/template post detail pages emit OpenGraph metadata including title, description, URL, type, and image metadata where available.
  • Twitter card metadata is supported, including summary_large_image for image-backed posts.
  • Preview image URLs are absolute when generated.
  • Existing page title/description/canonical behavior remains compatible.
  • Tests cover preview metadata behavior.
  • Documentation notes crawler cache behavior, including Mastodon preview caching.

Closing task as done.

_Synced from todu comment by @todu on 2026-06-28T12:39:59.227Z_ ### Closing summary - PR #225 was merged into `main`. - Local `main` is aligned with `origin/main` at merge commit `c0ade04`. - Prior review recorded Forgejo CI passing, approval, and acceptance criteria 6/6 met. Acceptance criteria verified: - Generated/template post detail pages emit OpenGraph metadata including title, description, URL, type, and image metadata where available. - Twitter card metadata is supported, including `summary_large_image` for image-backed posts. - Preview image URLs are absolute when generated. - Existing page title/description/canonical behavior remains compatible. - Tests cover preview metadata behavior. - Documentation notes crawler cache behavior, including Mastodon preview caching. Closing task as done.
Author
Owner

Synced from todu comment by @todu on 2026-06-28T12:39:28.802Z

Review update

  • PR: #225 is open with Forgejo CI passing.
  • Result: approved.
  • Follow-up: waiting for explicit human merge approval.

Acceptance criteria: 6/6 met. Blocking issues: 0. Warnings: 0.

_Synced from todu comment by @todu on 2026-06-28T12:39:28.802Z_ ### Review update - PR: https://forge.caradoc.com/erik/slugkit/pulls/225 is open with Forgejo CI passing. - Result: approved. - Follow-up: waiting for explicit human merge approval. Acceptance criteria: 6/6 met. Blocking issues: 0. Warnings: 0.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
erik/slugkit#219
No description provided.