Skip to content

Majors: link previews and search for a major's page - #197

Merged
dav3exe merged 1 commit into
devfrom
feat/major-share-preview
Nov 26, 2026
Merged

dav3exe merged 1 commit into
devfrom
feat/major-share-preview

Conversation

@dav3exe

@dav3exe dav3exe commented Nov 26, 2026

Copy link
Copy Markdown

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> adds share_title, share_text and share_image, so the website sets the same tags once it loads.
  • Partner pictures are fetched over https from public addresses only, with no redirects, a 6 MB cap and a short timeout. If one fails, the picture is drawn without it.

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.

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.
@coderabbitai

coderabbitai Bot commented Nov 26, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@dav3exe
dav3exe merged commit dc5e623 into dev Nov 26, 2026
7 checks passed
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