Repository navigation
Majors: link previews and search for a major's page - #197
Merged
Merged
Conversation
start.ng/majors/<slug> gets a server-written page (/pages/majors/<slug>) with the major's own title, description, Event data and preview picture, so X, WhatsApp and search engines show the major instead of the general start.ng page. The preview picture (/majors/<slug>/share.jpg, 1200x630) is drawn from the major's details: start.ng x the partner's logo, the title, the dates in Nigeria time, the prize on a ticket and the card picture fading in. Admins can give their own picture instead (majors.share_image_url, migration 0052). Partner pictures are fetched over https from public addresses only, with no redirects, a size cap and a short timeout. Published majors join the sitemap.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
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.
A pasted start.ng/majors/ link showed the general start.ng title and the Hangout picture, because X and WhatsApp only read the server's HTML. Now:
/pages/majors/<slug>: the website's HTML with the major's title ("Tech Ember Fest × start.ng"), description, Event data and preview picture, plus its text (games, prizes). Drafts and missing majors are a noindex 404. Published majors join the sitemap./majors/<slug>/share.jpg: a 1200x630 picture drawn from the major's details (start.ng × partner logo, title, game count, dates in Nigeria time, the prize on a ticket, the card picture fading in). Its address carries?v=, which changes when anything drawn changes.share_image_url(migration 0052): an optional picture of the admin's own that replaces the drawn one. Copied with the template.GET /majors/<slug>addsshare_title,share_textandshare_image, so the website sets the same tags once it loads.Pairs with the frontend PR that points nginx at
/pages/majors/<slug>. Deploy this one first.Note: the event spotlight draft also uses migration number 0052; whichever merges second renumbers.
Checked: full pytest in a clean python:3.12-slim container (1032 passed, 2 skipped), alembic heads is 0052. Drew the picture from the live Tech Ember Fest details locally, and fetched the page through the frontend's nginx as Twitterbot.