Give every page something to show when it is shared - #12
Merged
Merged
Conversation
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.
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.
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:
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.htmlemits the tags for every page from its own title and description, inside asocial_metablock so the landings replace them instead of appending. Appending would have emittedog:titletwice and left the scraper to pick one.pageisNonewhile 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.htmlis 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,#f8f9fband#d8b678are this site's own ink, paper and gold, so the card and the page a reader lands on are the same design.twitter:cardgoes fromsummarytosummary_large_image: a 1280×640 card shown as a thumbnail is a wasted card.Verified on the built site
index.htmlen/index.htmlmodules/01-…/programme/404.htmlExactly one
og:titleper page — no duplication from the block override.mkdocs build --strictclean,check_modules.pyclean.