Repository navigation
docs(site): add Open Graph, Twitter card and JSON-LD structured data - #18
Closed
astra-intelligence wants to merge 1 commit into
Closed
astra-intelligence wants to merge 1 commit into
astra-intelligence wants to merge 1 commit into
Conversation
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>
20 tasks
Author
|
Upstream has since implemented this exact feature in commit aff808d ( |
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.
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 Zensicalextraheadblock (wired viaproject.theme.custom_dir) that emits, on every page:og:title,og:description,og:url(the canonical URL),og:type,og:site_name,og:imagewith width/height/alttwitter:card = summary_large_imageplustwitter:title/description/imageSoftwareSourceCodeon the front page (name, description,programmingLanguage: Python,codeRepository,license, PyPIurl,isBasedOnlibphash's repo + site) and JSON-LDTechArticleon the guide pagesdocs/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 scripttools/site/make-social-preview.py(no machine paths).zensical.toml—custom_dir = "overrides".Verification
uv run --locked --only-group docs zensical build --strictpasses clean.og:image+twitter:cardwith absolute URLs (https://gudoshnikovn.github.io/python-libphash/assets/social-preview.png).SoftwareSourceCodeJSON-LD; guide pages carryTechArticleJSON-LD; both validated as parseable JSON.Checklist addressed
From #17's "Social previews and structured data (
overrides/main.html,extrahead)" section:og:*+twitter:card=summary_large_imagewith canonicalog:urland an absolute image URLtools/site/make-social-preview.py+ tracked PNG)SoftwareSourceCodeon the front page,TechArticleon guide pagesThe 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).