Visitors: full-width Doors analytics dashboard, SVG map, and fixed page titles

Merged
LU
5d ago
+636-1022

Rebuilds /about/visitors/ as a full-width FORRT Doors analytics dashboard with a Past 30 days / Past year switch, crenellated headline stat cards, a local SVG world choropleth map, ranked countries and pages with real page titles, and a daily visitors chart — and retires the site's unused vendored Leaflet copy. Addresses review feedback that the page could be better and had large empty bands.

What changes for visitors

  • Period switch & crenellated summary row: replaces two stacked long sections with a keyboard-accessible Past 30 days | Past year switch (supporting #past-year deep links; without JS both periods render cleanly one after the other). Four white stat cards with --brick3 slate crenellated tops highlight Visitors, Countries and regions, Typical day (median) with busiest day, and Most-read page — all computed in Hugo templates from data/ga_data.json on every build.
  • Doors SVG world map & Top countries: draws the world map directly as SVG from local countries.geojson in stepped --brick3 slate shades with matching legend and interactive tooltips. Pairs the map beside the Top 10 countries and regions (with a Visitors column header, share bars, no-location note, and Show all N locations disclosure).
  • Retires vendored Leaflet from the Hugo site: /about/visitors/ was the only page still using static/vendor/assets/leaflet/1.5.1/ (static/apps/community_map.html is a standalone R htmlwidgets iframe bundling its own copy, and the Contact widget is unused). Removes static/vendor/assets/leaflet/ (156 KB + 3 PNGs), removes the Leaflet <link>/<script> loaders in layouts/partials/site_head.html & site_js.html, sets [map] engine = 0 in config/_default/params.toml, and clears the three Leaflet PNG exemptions from scripts/webp_conversion/image_ignore_list.txt (data/assets.toml stays untouched because data/ is overwritten by data-artifact on deploy).
  • Most-read pages (real titles fixed!) & daily chart: fixes a pre-existing template bug where .Site.GetPage inside range always returned nil and displayed raw forrt.org/tags/ paths; all 20 current paths now resolve via site.GetPage / RelPermalink to real page titles (guarded by new check_seo_html.py check 34 + unit tests, handling both root and /rebrand-doors/ subfolder builds). Adds a Views column header beside a compact Doors-palette Chart.js daily chart with dashed median and orange busiest-day peak dot.
  • Dedicated stylesheet: page styles live in assets/css/doors/visitors.css, loaded conditionally via doors/assets.html; six legacy ga_* shortcodes are consolidated into ga_visitors + two partials.

Before / After

Desktop (1440 px) — BeforeDesktop (1440 px) — After (Past 30 days)
Before desktopAfter desktop 30d
Desktop (1440 px) — After (Past year)
After desktop year
Mobile (390 px) — BeforeMobile (390 px) — After
Before mobileAfter mobile

Decisions to review

  • Four summary stat cards: kept all four crenellated headline KPI cards (Visitors, Countries and regions, Typical day, Most-read page) for immediate at-a-glance scanning; Claude Opus 5.5 noted that median/most-read also appear below and could optionally be trimmed to two stats if a shorter header is preferred.
  • Singapore traffic in data/ga_data.json: the committed local data/ga_data.json shows a large Singapore share (8,079 of 14,206 in 30 days) — worth checking GA4 bot filtering separately in analytics settings, without modifying generated data/ga_data.json here.
  • Community map iframe: static/apps/community_map.html (generated externally by R htmlwidgets) still bundles its own inline Leaflet + tile URLs; everything in Hugo templates and static/vendor/assets/leaflet/ is now Leaflet-free.

Checks & design review

  • Rebased onto rebrand-doors (fcfd974de2); check_seo_html.py check renumbered to 34 after Bulgarian glossary checks 32–33
  • scripts/rebrand/check_source_rules.py --base origin/rebrand-doors: 0 hard-coded URLs, 0 generated paths changed
  • scripts/check_seo_html.py (all 34 checks) & python3 -m unittest scripts/tests/test_check_seo_html.py (84 tests): pass
  • scripts/rebrand/check_design.py on /about/visitors/ and /community-map/: 0 failures
  • Final taste review by Claude Opus 5.5 and GPT-6.2 Astra: both SHIP WITH MINOR TWEAKS; all tweaks applied.

Created with Claude Opus 5.5 (Claude Code) and Gemini 4 Neon (Antigravity) in T3 Code; mockups and final review by Claude Opus 5.5 and GPT-6.2 Astra.