Skip to content

Open Graph cards emit invalid og:type="thumbnail" for posts using the blog fallback image #74

Description

@jmacdotorg

Summary

When Plerd generates Open Graph metadata for a post that relies on the blog-wide fallback image (i.e. the post does not define its own image: attribute), it emits a spec-invalid og:type:

<meta property="og:type" content="thumbnail"/>

thumbnail is not a valid Open Graph type — it's a Twitter-card concept that HTML::SocialMeta leaks into its Open Graph output. Posts that define their own image: are unaffected (they render og:type="article", which is valid).

Root cause

Plerd::Post chooses a socialmeta_mode automatically:

  • summary (the default) — used when the post falls back to the blog's image config.
  • featured_image — used when the post defines its own image: attribute.

HTML::SocialMeta maps these to its Open Graph card builders:

  • summarycreate_thumbnailog:type="thumbnail"invalid
  • featured_imagecreate_articleog:type="article" ← valid

The summarythumbnail mapping is correct for Twitter Cards (twitter:card=summary) but wrong for Open Graph, where thumbnail is not a defined object type.

Impact

Mostly cosmetic: consumers such as Discord and Slack ignore an unrecognized og:type and still render a link preview. But the markup is malformed, and it affects the common case (any post without its own image), not an edge case.

This became more visible after Open Graph tags began emitting for every post with an image (previously OG output was gated behind a configured facebook_id). So a much larger share of generated pages now carry the invalid type.

Possible fixes (Plerd-side, without patching HTML::SocialMeta)

  1. Post-process the Open Graph output in Plerd::Post::_build_social_meta_tags, rewriting og:type="thumbnail"og:type="article" (same shape as the existing empty-fb:app_id cleanup). Lowest risk; leaves the Twitter summary card untouched.
  2. Always request the featured_image/article card for Open Graph regardless of the post's socialmeta_mode. Cleaner conceptually, but couples the Open Graph and Twitter mode handling.

Notes

Found while fixing the related Open Graph gating bug. Filing rather than fixing inline to keep that change focused.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions