Skip to content

Add descriptive page titles and social link-preview (Open Graph) metadata#824

Open
GHPBZ wants to merge 1 commit into
masterfrom
feat/portal-titles-og-metadata
Open

Add descriptive page titles and social link-preview (Open Graph) metadata#824
GHPBZ wants to merge 1 commit into
masterfrom
feat/portal-titles-og-metadata

Conversation

@GHPBZ

@GHPBZ GHPBZ commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

What

Gives dataset, tool/pipeline, and experiment pages their own browser title and
their own social link-preview, and replaces the site's placeholder meta
description with a real one.

  • Per-dataset browser titles. The dataset page hard-coded
    <title>CONP Portal | Dataset</title> for every dataset. It now shows the
    dataset's own title (CONP Portal | {{ data.title }}), matching what the tool
    and experiment pages already do. Closes More descriptive browser page titles for the Portal #754.
  • Open Graph tags for link previews. base_main.html previously shipped only
    a Twitter Card with a single site-wide title. Added standard Open Graph tags
    (og:type, og:site_name, og:title, og:description, og:image,
    og:url) so that pasting a CONP link into Slack, Teams, Bluesky, LinkedIn,
    Mastodon, iMessage, or a document produces a real preview. Dataset, pipeline,
    and experiment pages override og:title / og:description (datasets also
    og:url) so each has its own card. The Twitter Card tags now mirror the Open
    Graph values so the two never drift.
  • Real meta description. <meta name="description" content="CONP"> is now a
    one-sentence description of the Portal (this is the text search engines show).
  • Social handle. twitter:site is set to the CONP Bluesky handle
    @CONP_PCNO (was @NeuroLibre). Bluesky itself builds link cards from the
    Open Graph tags above; the handle tag is kept for X/Twitter attribution.

How it works

The social values are overridable Jinja blocks in base_main.html
(meta_description, og_title, og_description, og_image, og_url). Pages
that know their subject override the relevant blocks; every other page falls back
to site-wide defaults. The Twitter tags render from the same blocks via
self.og_title() etc. All per-page values have fallbacks, and dataset/tool
descriptions are passed through striptags | truncate(200) for a clean card.

Files

  • app/templates/common/base_main.html — meta description; Open Graph + mirrored
    Twitter tags as overridable blocks; twitter:site set to @CONP_PCNO.
  • app/templates/dataset.html — per-dataset <title>; og overrides.
  • app/templates/pipeline.html — og overrides.
  • app/templates/experiments/experiment.html — og overrides.

Templates only; no route, model, dependency, or build changes.

Testing

  • All four templates compile under Jinja2.
  • A standalone render harness confirms child block overrides flow into both the
    Open Graph and mirrored Twitter tags, that HTML in descriptions is stripped and
    escaped, and that the missing-title / missing-description fallbacks fire.

Possible follow-up

og:image is the site-wide CONP card on every page. Per-dataset images (via the
existing /dataset_logo endpoint) are a natural follow-up but were left out here
because dataset logos vary in size/availability and could produce broken cards.

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.

More descriptive browser page titles for the Portal

1 participant