NEWS RELAUNCH CUTOVER: promote the hub to /, feed to /news, go public
The big flip. /home3 (hub) becomes /; the feed lives at /news; both indexable. - PROMOTE: routes/+page.svelte is now the hub (was the interim NewsFeed wrapper); noindex removed; "Read more good news" → /news. routes/home3 + home2 deleted. - routes/+page.js: redirects legacy root-query links (/?view=latest, /?tag, /?source, /?q, /?view=today→highlights) to /news before the hub renders (no flash). - /news: noindex dropped (route meta + Caddy @newsHidden removed); now public. - LINKS: HubBar brand/Home → /, News default → /news; HubShell/art/play back → /; account Following + share.py Explore/Browse/source → /news. - FOOTER: one shared Footer.svelte (motto + Send feedback + slot) across Hub/News/ Play/Art/HubShell/Account/Zen; global layout footer removed (FeedbackModal stays). - SITEMAP: + /news /art /play /word /quote /onthisday; cap 5k→50k; gated on has-summary; paywalled excluded; HEAD now 200 (api_route GET+HEAD). - Head-patcher: /news entry. PWA + shell description broadened to the hub. - Caddy: @newsHidden dropped; @hidden now admin-only (word/quote/onthisday public); /home2,/home3 → / 301. Mirrored to deploy/caddy snapshot. 425 backend + 36 frontend tests green; build clean; Caddy valid. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+12
-2
@@ -1695,22 +1695,32 @@ def create_app() -> FastAPI:
|
||||
return HTMLResponse(share.render_not_found(PUBLIC_BASE_URL), status_code=404)
|
||||
return HTMLResponse(share.render_digest(items, PUBLIC_BASE_URL, b.get("brief_date")))
|
||||
|
||||
@app.get("/sitemap.xml")
|
||||
@app.api_route("/sitemap.xml", methods=["GET", "HEAD"])
|
||||
def sitemap() -> Response:
|
||||
with get_conn() as conn:
|
||||
pwx = queries.paywalled_source_ids(conn)
|
||||
pw_clause = f" AND a.source_id NOT IN ({','.join('?' * len(pwx))})" if pwx else ""
|
||||
# Only articles with a real summary (the page has substance), paywalled excluded.
|
||||
# Cap near the 50k protocol ceiling so older canonical pages aren't dropped.
|
||||
rows = conn.execute(
|
||||
"SELECT a.id, COALESCE(a.published_at, a.discovered_at) AS lm "
|
||||
"FROM articles a JOIN article_scores s ON s.article_id = a.id "
|
||||
"WHERE s.accepted = 1 AND a.duplicate_of IS NULL" + pw_clause + " "
|
||||
"ORDER BY lm DESC LIMIT 5000",
|
||||
"AND EXISTS (SELECT 1 FROM article_summaries asum WHERE asum.article_id = a.id) "
|
||||
"ORDER BY lm DESC LIMIT 50000",
|
||||
pwx,
|
||||
).fetchall()
|
||||
base = PUBLIC_BASE_URL
|
||||
# Hub + the public sections, then every summarized article page.
|
||||
urls = [
|
||||
f"<url><loc>{base}/</loc><changefreq>hourly</changefreq><priority>1.0</priority></url>",
|
||||
f"<url><loc>{base}/news</loc><changefreq>hourly</changefreq><priority>0.9</priority></url>",
|
||||
f"<url><loc>{base}/today</loc><changefreq>daily</changefreq><priority>0.9</priority></url>",
|
||||
f"<url><loc>{base}/art</loc><changefreq>daily</changefreq><priority>0.6</priority></url>",
|
||||
f"<url><loc>{base}/play</loc><changefreq>weekly</changefreq><priority>0.5</priority></url>",
|
||||
f"<url><loc>{base}/word</loc><changefreq>daily</changefreq><priority>0.5</priority></url>",
|
||||
f"<url><loc>{base}/quote</loc><changefreq>daily</changefreq><priority>0.5</priority></url>",
|
||||
f"<url><loc>{base}/onthisday</loc><changefreq>daily</changefreq><priority>0.5</priority></url>",
|
||||
]
|
||||
for r in rows:
|
||||
lm = (r["lm"] or "")[:10]
|
||||
|
||||
Reference in New Issue
Block a user