| name | Stats dashboard redesign | |||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| overview | Revamp `/stats/` from plain tables into a wider, dark-theme dashboard with KPI cards and CSS bar charts—same data sources, visual mockup first for sign-off before any code. | |||||||||||||||||||||||||||||||||||
| todos |
|
|||||||||||||||||||||||||||||||||||
| isProject | false |
[src/misc/stats.html](src/misc/stats.html) is a Vue 2 page that loads /stats.json (build-time post metrics), /.netlify/functions/deploy-status, and /api/get-stats (Buttondown). Everything is plain tables inside the narrow .basic-page (800px) layout. No cards, no charts, almost no page-specific styling beyond the site’s dark green theme in [src/assets/css/styles.css](src/assets/css/styles.css).
- Look: Dashboard within the existing dark / green brand (
--dark-bg,--card-bg,--light-green, etc.)—not a new visual language. - Depth: KPI cards + CSS percentage bars / sparklines. No chart library.
- Preview gate: After plan approval, generate a static mockup image and pause for visual sign-off before touching code.
- Scope: Same metrics and APIs; presentation and light UX polish only (loading state, wider layout). Keep Vue 2 + Moment for this pass to avoid a framework rewrite.
flowchart TB
subgraph header [Page header]
Title[Stats]
end
subgraph kpi [KPI strip]
Posts[Total Posts]
Words[Total Words]
Avg[Avg Words]
Subs[Subscribers]
Build[Build Status]
end
subgraph timeline [Timeline cards]
First[First Post]
Last[Latest Post]
end
subgraph activity [Activity]
Weeks[Last 8 Weeks - horizontal bars]
Years[Posts Per Year - horizontal bars]
end
subgraph taxonomy [Taxonomy]
Cats[Categories - ranked bars]
Tags[Tags - ranked bars]
end
subgraph yearly [Year explorer]
Select[Year select]
Combined[Combined cat/tag bars]
end
Title --> kpi --> timeline --> activity --> taxonomy --> yearly
Desktop (≈1100–1200px content width):
- KPI strip — 5 metric cards in a responsive grid: Total Posts, Total Words, Avg Words/Post, Email Subscribers, Build Status (status pill + published time when ready).
- First / Latest — two side-by-side cards with title link, date, and relative age.
- Last 8 weeks — labeled horizontal bars (
width: hits / max * 100%). - Posts per year — same bar pattern over the year list (newest or oldest first; default newest-first for scanability).
- Categories | Tags — two columns of ranked bars (sort by count descending instead of A–Z so the dashboard reads as “top topics”).
- Year explorer — year
<select>+ ranked bars for combined cat/tag stats.
Mobile: KPI grid collapses to 2 columns then 1; taxonomy stacks; bars remain full-width.
Visual language: use existing --card-bg surfaces, subtle borders (--border-color), green accent on bar fills and headings, large tabular numbers for KPIs. Escape the 800px .basic-page constraint with a page-specific wrapper (e.g. .stats-dashboard with max-width: 1100px) so it feels like a dashboard, not a blog article.
- Generate one 16:9 mockup image matching the layout above and the site’s dark green palette.
- You review / request tweaks.
- Only after that: implement in the live page.
| Piece | Change |
|---|---|
| Markup | Replace tables in [src/misc/stats.html](src/misc/stats.html) with semantic dashboard sections + Vue bindings |
| Styles | Page-scoped CSS in the same file (or a small stats.css copied via Eleventy if preferred)—cards, grid, bar tracks/fills, status pill, loading skeleton |
| Layout | Override narrow page width for this route only |
| Logic | Reuse existing created / computed data; add maxWeekHits / maxYearHits (and similar) for bar widths; sort cats/tags/year-stats by size desc; add loading / graceful partial failure so one bad API doesn’t blank the page |
| Data | No changes to [src/misc/stats.ejs](src/misc/stats.ejs) or Netlify functions unless something is clearly broken |
Out of scope for this pass: Vue 3 migration, new metrics (page views, etc.), Chart.js, redesign of unrelated site pages.
/stats/reads as a single cohesive dashboard on first scroll.- All current metrics remain available.
- Bars make weekly/yearly/category volume scannable at a glance.
- Still works with existing
/stats.json+ functions undernetlify dev. - Matches site dark/green styling; no purple/cream AI-default look.