2cfffdfd6a
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>
18 lines
969 B
JavaScript
18 lines
969 B
JavaScript
import { redirect } from '@sveltejs/kit';
|
|
|
|
// Keep legacy root-query links alive after the cutover: the old feed lived at `/`
|
|
// (e.g. /?view=latest, /?tag=…, /?source=…, /?q=…); the feed is now /news. Redirect
|
|
// here in load() — before the hub renders — so bookmarks/old shares never flash the
|
|
// hub. Bare `/` (no query) falls through to the hub. parseView's alias keeps
|
|
// /news?view=today working too.
|
|
export function load({ url }) {
|
|
const p = url.searchParams;
|
|
if (p.get('q')) throw redirect(307, '/news?q=' + encodeURIComponent(p.get('q')));
|
|
if (p.get('source')) throw redirect(307, '/news?source=' + encodeURIComponent(p.get('source')));
|
|
if (p.get('tag')) throw redirect(307, '/news?tag=' + encodeURIComponent(p.get('tag')));
|
|
const v = p.get('view');
|
|
if (v === 'today') throw redirect(307, '/news?view=highlights');
|
|
if (v === 'latest') throw redirect(307, '/news');
|
|
if (v) throw redirect(307, '/news?view=' + encodeURIComponent(v));
|
|
}
|