Skip to content

docs(site): add share cards, structured data and a sitemap line in robots.txt - #118

Merged
stephen-masters merged 1 commit into
mainfrom
docs/site-share-cards-structured-data
Nov 27, 2026
Merged

stephen-masters merged 1 commit into
mainfrom
docs/site-share-cards-structured-data

Conversation

@stephen-masters

Copy link
Copy Markdown
Contributor

Why

A link to tetrak.dev arrived as a bare URL wherever it was shared. The head carried no Open Graph tags, no share image and no structured data, and robots.txt was Hugo's one-line default, which names no sitemap.

What changes

  • Share cards. Open Graph tags and a Twitter card on every page (partials/social.html). The card, the meta description and the structured data read one description from partials/description.html, so they cannot disagree.
  • Share image. assets/images/design/share-card.png, drawn from the design tokens and the home page's standfirst by scripts/render-share-card.mjs and committed. The two existing illustrations are both about the OCR tool, so neither could stand for the whole site. It is a PNG at an unfingerprinted address on purpose: scrapers cache the URL, and not all of them read WebP.
  • Structured data. JSON-LD on three kinds of page (partials/structured-data.html):
    • the home page: Organization and WebSite
    • an article: TechArticle, with the author from data/authors.toml
    • a product page: SoftwareSourceCode, from a new software map in its front matter (name, repository, licence, language); a missing key fails the build
  • Organisation profiles. params.profiles lists the Hugging Face and PyPI tetrak profiles as sameAs. The scattercode GitHub organisation is left out because it holds other projects too.
  • robots.txt now names the sitemap.
  • The design skill has a section on the above.

Worth a look

The share image is a design choice: the name in Playfair Display over the home page's standfirst, on the paper ground. Re-run the script after changing that standfirst.

Testing

Six new browser tests: every page has a share card and the image is in the build; a tag page is shared as "Tagged x"; an article's structured data matches its heading, date and byline; each product page names its package, repository and licence; the home page names the publisher; robots.txt names a sitemap that exists.

npm run lint, npm run build and npx playwright test (43 tests) pass locally.

docs(site): so that no package release is cut.

🤖 Generated with Claude Code

…bots.txt

A link to tetrak.dev arrived as a bare URL wherever it was shared: the head
carried no Open Graph tags, no share image and no structured data, and
robots.txt was Hugo's one-line default, which names no sitemap.

- Open Graph tags and a Twitter card on every page, sharing one
  description with the meta description (partials/description.html).
- A share image drawn from the design tokens and the home page's
  standfirst by scripts/render-share-card.mjs, and committed.
- JSON-LD: Organization and WebSite on the home page, TechArticle on
  articles with the author from the byline register, SoftwareSourceCode
  on the four product pages from a new `software` front-matter map.
- robots.txt names the sitemap.
- Six browser tests, and a section in the design skill.

Co-authored-by: Yvette Mankerian <yvettekm@gmail.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@stephen-masters
stephen-masters merged commit c1c8a77 into main Nov 27, 2026
9 checks passed
@stephen-masters
stephen-masters deleted the docs/site-share-cards-structured-data branch November 27, 2026 23:30
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