Skip to content

Give every page something to show when it is shared - #12

Merged
DenisDrobyshev merged 1 commit into
mainfrom
add/social-cards-on-every-page
Sep 20, 2026
Merged

DenisDrobyshev merged 1 commit into
mainfrom
add/social-cards-on-every-page

Conversation

@DenisDrobyshev

Copy link
Copy Markdown
Member

Only the two landing pages carried Open Graph tags — hand-written, and neither had an image. Checked against the live site, the other fifty-four pages had none at all:

modules/01-claim-baseline-noise/   og:title — ОТСУТСТВУЕТ   og:image — ОТСУТСТВУЕТ
programme/                          og:title — ОТСУТСТВУЕТ   og:image — ОТСУТСТВУЕТ

That is the wrong way round. The shareable unit of a course is a module — «вот модуль про дофамин и TD-обучение» — and the module was the one thing with nothing to show.

How

overrides/main.html emits the tags for every page from its own title and description, inside a social_meta block so the landings replace them instead of appending. Appending would have emitted og:title twice and left the scraper to pick one.

page is None while the theme renders the 404, so every access is guarded. Without that the build dies with 'None' has no attribute 'meta' and mkdocs does not say which template — which is how I found it.

Shadowing main.html is safe here: the theme's own is {% extends "base.html" %} and nothing else. I checked before writing it.

The card

The one the organisation's generator already draws for lemma. Its palette is not a coincidence — #0a0b0e, #f8f9fb and #d8b678 are this site's own ink, paper and gold, so the card and the page a reader lands on are the same design.

twitter:card goes from summary to summary_large_image: a 1280×640 card shown as a thumbnail is a wasted card.

Verified on the built site

page og:title count card
index.html lemma — дорожная карта… 1 large
en/index.html lemma — a roadmap… 1 large
modules/01-…/ Модуль 1. Что значит «работает» 1 large
programme/ Программа 1 large
404.html lemma (falls back, does not crash) 1 large

Exactly one og:title per page — no duplication from the block override. mkdocs build --strict clean, check_modules.py clean.

Only the two landings carried Open Graph tags, hand-written, and neither had an
image. The other fifty-four pages had none at all: shared anywhere, a module
produced a bare link with no title and no card.

That is the wrong way round. The shareable unit of a course is a module -- "вот
модуль про дофамин и TD-обучение" -- and the module was the one thing with
nothing to show.

main.html emits the tags for every page from its own title and description, in
a `social_meta` block so the landings can replace them rather than append:
appending would have emitted og:title twice and left the scraper to choose.
`page` is None while the theme renders the 404, so every access is guarded --
without that the build dies with "'None' has no attribute 'meta'" and does not
say which template.

The card is the one the organisation's generator already draws for lemma. Its
palette is not a coincidence: #0a0b0e, #f8f9fb and #d8b678 are the site's own
ink, paper and gold, so the card and the page a reader lands on are the same
design.

twitter:card goes from summary to summary_large_image, because a 1280×640 card
shown as a thumbnail is a wasted card.
@DenisDrobyshev
DenisDrobyshev merged commit ebff5b0 into main Sep 20, 2026
5 checks passed
@DenisDrobyshev
DenisDrobyshev deleted the add/social-cards-on-every-page branch September 20, 2026 14:12
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