Skip to content

Commit 89b2814

Browse files
palewireclaude
andcommitted
Componentize, design tokens, earliest-snapshot links
Three independent improvements: 1. Earliest-snapshot wayback links. site_data now builds each headline's wayback_url from curated.first_seen_ts instead of reusing the enriched.csv link (which used last_seen_ts and tended to point at 2024 mementos for old articles). No re-fetching needed — the metadata didn't change, only the link does. Verified: the 2015 Cubs-Pirates wild-card liveblog now links to a 2015-10-09 capture (three days after the game) instead of a 2024 capture. 2. Componentized SvelteKit. The home route was carrying all of the header, footer, tagline, search, year list, and byline teaser inline. Split into seven components under src/lib/components/ with a barrel re-export: SiteHeader / SiteFooter / Tagline / SearchBox / YearList / BylineTeaser / EntryList Pages now read top-down at a glance. 3. Expanded :root design tokens in app.css. Colors, font stack, font sizes, weights, line-heights, spacing scale, page max-width, and rule weights all expressed as custom properties. Restyling the whole site is editing a dozen tokens. Also: svelte.config.js now picks base path automatically. CNAME present in static/ -> custom domain (base ''). Absent -> gh-pages subpath ('/fakethirtyeight.com'). Drop a CNAME file in to flip. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c04b4af commit 89b2814

17 files changed

Lines changed: 21516 additions & 21409 deletions

File tree

src/fakethirtyeight/site_data.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,21 +148,26 @@ def _build_record(
148148
kind = curated_row.get("kind") or ""
149149
url = curated_row.get("url") or ""
150150

151+
# Always link to the EARLIEST snapshot we know of (curated.first_seen_ts).
152+
# The article's metadata is identical across captures, but the earliest
153+
# snapshot is closer to "how the site actually looked then" and avoids
154+
# linking 2015 articles to 2024 mementos captured during the site's
155+
# final months. Falls back to last_seen_ts when first is missing.
156+
earliest_ts = (
157+
curated_row.get("first_seen_ts") or curated_row.get("last_seen_ts") or ""
158+
)
159+
wayback_url = _build_wayback_url(earliest_ts, url) if earliest_ts else ""
160+
151161
if enrich_row:
152162
# Re-clean titles to apply any extractor improvements that landed
153163
# after enrich.csv was written (e.g., Blogspot-era prefix stripping).
154164
title = _clean_title(enrich_row.get("title") or "")
155165
byline = enrich_row.get("byline") or ""
156166
date = enrich_row.get("published_at") or ""
157-
wayback_url = enrich_row.get("wayback_url") or ""
158167
else:
159168
title = ""
160169
byline = ""
161-
date = curated_row.get("last_seen_ts") or curated_row.get("first_seen_ts") or ""
162-
wayback_url = _build_wayback_url(
163-
curated_row.get("last_seen_ts") or curated_row.get("first_seen_ts") or "",
164-
url,
165-
)
170+
date = earliest_ts
166171

167172
# Fall back to a slug-derived title when we couldn't extract one.
168173
if not title:

0 commit comments

Comments
 (0)