Skip to content

SEO header generation — localize keywords + full meta surface across all 14 languages#2539

Merged
pethers merged 9 commits into
mainfrom
copilot/improve-seo-headers
May 17, 2026
Merged

SEO header generation — localize keywords + full meta surface across all 14 languages#2539
pethers merged 9 commits into
mainfrom
copilot/improve-seo-headers

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 17, 2026

SEO Header Generation — Comprehensive Improvement

Improving SEO headers across every page population so each language gets a complete, locale-aware <head> driven (where applicable) by the per-language executive brief.

Page populations in scope

  • A) News articles news/$DATE-$SUB-$LANG.html — renderer pipeline
  • B) Political-intelligence index political-intelligence{,_$LANG}.html × 14
  • C) Dashboard hubs dashboards/*{,_$LANG}.html × 126
  • D) Static homepage index{,_$LANG}.html × 14
  • E) Politician dashboard politician-dashboard{,_$LANG}.html × 14
  • F) Dashboard root dashboard/index{,_$LANG}.html × 14

Work checklist

  • W1 Localize news-article keywords per language — 31 tests
  • W2 Per-language <meta description> SERP windows — 13 tests
  • W3 Political-intelligence keyword leak fixed — 14 PI pages regenerated
  • W4 New static-pages-seo-head.ts + 42 static pages regenerated — 28 tests
  • W5 Dashboard hub keyword leak fixed — 126 dashboard HTML files regenerated
  • W6 NewsArticle.keywords[] + articleSection in JSON-LD
  • W7 Regenerated every renderer-owned news article (2408 files across 172 subfolders × 14 languages) through the improved SEO chrome — og:locale:alternate × 13, canonical og:site_name, JSON-LD keyword arrays now land on every renderable article
  • W8 Legacy news backfill (scripts/backfill-news-og-locale-alternate.ts) for the residual hand-authored breaking-news / realtime-pulse / evening-analysis files that ship outside the renderer:
    • 2602 files received the 13-tag og:locale:alternate block on first run
    • 2 files had non-canonical locales (no_NO, en_GB) normalized to canonical nb_NO / en_US and then alternate-injected
    • 61 files correctly skipped (no og:locale tag to anchor against — owned by older template that ships a sparse head)
    • Script is idempotent, pure-string, fully typed; covered by 29 unit tests (14-language matrix + whitespace preservation + alias normalization + idempotency)

Architecture, bounded context & quality assurance

  • W7 / W8 split is deliberate: renderer regeneration owns every article with an article.md source (pipeline-clean output); the tested, idempotent backfill only touches the residual legacy files that have no markdown source to regenerate from.
  • Non-canonical og:locale aliases are centralized in OG_LOCALE_ALIASES (no_NOnb_NO, en_GBen_US) and applied before the alternate-injection guard so a single pass both normalizes and completes the head.

Verification

  • 6396 tests pass | 34 skipped (full vitest suite, +29 from W8)
  • HTMLHint clean — 5 093 files scanned, no errors
  • ✅ Renderer regeneration: 2408 articles emitted across 172 subfolders × 14 languages
  • ✅ Backfill: 2604 legacy files updated (incl. 2 alias normalizations); 5044 already complete; 0 unknown-locale failures

Copilot AI requested a review from pethers May 17, 2026 07:54
@github-actions github-actions Bot added dashboard Interactive dashboards (Chart.js/D3.js) html-css HTML/CSS changes i18n Internationalization/localization translation Translation updates rtl RTL language support (Arabic, Hebrew) testing Test coverage refactor Code refactoring size-xl Extra large change (> 1000 lines) labels May 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🏷️ Automatic Labeling Summary

This PR has been automatically labeled based on the files changed and PR metadata.

Applied Labels: dashboard,html-css,i18n,translation,rtl,testing,refactor,size-xl

Label Categories

  • 🗳️ Content: news, dashboard, visualization, intelligence
  • 💻 Technology: html-css, javascript, workflow, security
  • 📊 Data: cia-data, riksdag-data, data-pipeline, schema
  • 🌍 I18n: i18n, translation, rtl
  • 🔒 ISMS: isms, iso-27001, nist-csf, cis-controls
  • 🏗️ Infrastructure: ci-cd, deployment, performance, monitoring
  • 🔄 Quality: testing, accessibility, documentation, refactor
  • 🤖 AI: agent, skill, agentic-workflow

For more information, see .github/labeler.yml.

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

Comment thread tests/static-pages-seo.test.ts Fixed
Comment thread tests/static-pages-seo.test.ts Fixed
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

@github-actions github-actions Bot added the javascript JavaScript code changes label May 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

…gacy news files; normalize 2 non-canonical locales

Agent-Logs-Url: https://github.com/Hack23/riksdagsmonitor/sessions/894780ff-3a35-41e0-aa62-db1fb94101c7

Co-authored-by: pethers <1726836+pethers@users.noreply.github.com>
@github-actions github-actions Bot added news News articles and content generation size-xs Extra small change (< 10 lines) labels May 17, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

@pethers pethers marked this pull request as ready for review May 17, 2026 12:52
Copilot AI review requested due to automatic review settings May 17, 2026 12:52
@pethers pethers merged commit 0b2bd4c into main May 17, 2026
@pethers pethers deleted the copilot/improve-seo-headers branch May 17, 2026 12:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Lighthouse Performance Audit

Category Score Status
Performance 85/100 🟡
Accessibility 95/100 🟢
Best Practices 90/100 🟢
SEO 95/100 🟢

📥 Download full Lighthouse report

Budget Compliance: Performance budgets enforced via budget.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dashboard Interactive dashboards (Chart.js/D3.js) html-css HTML/CSS changes i18n Internationalization/localization javascript JavaScript code changes news News articles and content generation refactor Code refactoring rtl RTL language support (Arabic, Hebrew) size-xl Extra large change (> 1000 lines) size-xs Extra small change (< 10 lines) testing Test coverage translation Translation updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants