Skip to content

docs(site): add Open Graph, Twitter card and JSON-LD structured data - #18

Closed
astra-intelligence wants to merge 1 commit into
gudoshnikovn:mainfrom
astra-intelligence:social-preview-meta
Closed

astra-intelligence wants to merge 1 commit into
gudoshnikovn:mainfrom
astra-intelligence:social-preview-meta

Conversation

@astra-intelligence

Copy link
Copy Markdown

What

Implements the Social previews and structured data section of #17 (overrides/main.html, extrahead) and the C-library epic's approach (libphash#51, libphash#52):

  • overrides/main.html — a Zensical extrahead block (wired via project.theme.custom_dir) that emits, on every page:
    • og:title, og:description, og:url (the canonical URL), og:type, og:site_name, og:image with width/height/alt
    • twitter:card = summary_large_image plus twitter:title/description/image
    • JSON-LD SoftwareSourceCode on the front page (name, description, programmingLanguage: Python, codeRepository, license, PyPI url, isBasedOn libphash's repo + site) and JSON-LD TechArticle on the guide pages
  • docs/assets/social-preview.png — a 1200×630 preview generated from the site's own hash-bit logo grid in its accent #2a78d6, regenerable via the committed Pillow-only script tools/site/make-social-preview.py (no machine paths).
  • zensical.toml — custom_dir = "overrides".

Verification

  • uv run --locked --only-group docs zensical build --strict passes clean.
  • All 25 built pages emit og:image + twitter:card with absolute URLs (https://gudoshnikovn.github.io/python-libphash/assets/social-preview.png).
  • Front page carries SoftwareSourceCode JSON-LD; guide pages carry TechArticle JSON-LD; both validated as parseable JSON.
  • Preview card vision-QA'd: text fully visible, no clipping, on-brand.

Checklist addressed

From #17's "Social previews and structured data (overrides/main.html, extrahead)" section:

  • og:* + twitter:card=summary_large_image with canonical og:url and an absolute image URL
  • 1200×630 preview image generated in the repository (tools/site/make-social-preview.py + tracked PNG)
  • JSON-LD SoftwareSourceCode on the front page, TechArticle on guide pages

The per-page title/description front matter and the duplicate-description strict check are the remaining part of #17 and can follow in a separate PR (they touch every page's content rather than the theme).

Closes the social-preview and structured-data part of gudoshnikovn#17.

- overrides/main.html: extrahead block emitting og:*, twitter:card and
  JSON-LD (SoftwareSourceCode on the front page, TechArticle on guide pages)
  from the same title/description the theme already renders, plus the
  canonical URL and an absolute og:image.
- docs/assets/social-preview.png: 1200x630 card drawn from the site's own
  logo (hash-bit grid in the site accent #2a78d6) by a portable Pillow
  script, tools/site/make-social-preview.py.
- zensical.toml: theme.custom_dir = overrides.

Verified with a strict build: every one of the 25 pages emits og:image,
twitter:card and a per-page og:title; the front page carries
SoftwareSourceCode JSON-LD and guide pages TechArticle JSON-LD.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
@astra-intelligence

Copy link
Copy Markdown
Author

Upstream has since implemented this exact feature in commit aff808d (docs(site): page titles, descriptions, social previews and structured data, Oct 16) — per-page title/description, the full OG/Twitter set, JSON-LD (WebSite, SoftwareSourceCode, TechArticle, BreadcrumbList), a 1200x630 social.png, and noindex on the 404. That implementation is more complete than this PR, so this PR is superseded. Closing it to keep the queue clean — no action needed from you. Thanks for the great repo!

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