review round 2: deterministic checks (npm run check: build + zero-dep link checker; tsconfig with docs-recommended include/exclude, astro check dropped — OOMs at 12GB on a 200-entry collection), sitemap static pages derived from route files, non-recursive content glob (id/slug trap), --header-h token, honest CDN comments (sveltia UI fonts), preview.css drift (prose a wrap, img block, h1 size)
This commit is contained in:
@@ -122,7 +122,8 @@ const readMin = readMinOf(post);
|
||||
let observer;
|
||||
const observe = () => {
|
||||
observer?.disconnect();
|
||||
// Narrow band below the sticky header (56px) — Starlight's rootMargin trick
|
||||
// Narrow band below the sticky header (--header-h 56px + 12px slack;
|
||||
// JS can't read the token cheaply, keep in sync) — Starlight's rootMargin trick
|
||||
const top = 68, band = 64;
|
||||
observer = new IntersectionObserver(onIntersect, {
|
||||
rootMargin: `-${top}px 0px ${top + band - document.documentElement.clientHeight}px`,
|
||||
|
||||
@@ -13,10 +13,17 @@ export async function GET(context) {
|
||||
.sort((a, b) => b.data.date.valueOf() - a.data.date.valueOf());
|
||||
const pages = await getCollection('pages');
|
||||
|
||||
// Go-live note: /login and /dashboard are mock pages — drop them from this
|
||||
// list (or gate them) before robots.txt stops disallowing everything.
|
||||
// Static pages come from the actual route files, so a new src/pages/*.astro
|
||||
// can never be forgotten here. 404 is excluded; /admin (subdirectory) is
|
||||
// intentionally unlisted. Go-live note: /login and /dashboard are mock
|
||||
// pages — filter them out before robots.txt stops disallowing everything.
|
||||
const staticPages = Object.keys(import.meta.glob('./*.astro'))
|
||||
.map((p) => p.slice(1, -'.astro'.length))
|
||||
.filter((p) => p !== '/404')
|
||||
.map((p) => (p === '/index' ? '/' : p))
|
||||
.sort();
|
||||
const urls = [
|
||||
'/', '/news', '/proposals', '/dashboard', '/support', '/search', '/login',
|
||||
...staticPages, '/news',
|
||||
...Array.from({ length: newsPageCount(news.length) - 1 }, (_, i) => `/news/${i + 2}`),
|
||||
...pages.map((p) => `/pages/${p.id}`),
|
||||
].map((path) => ` <url><loc>${new URL(path, site).href}</loc></url>`);
|
||||
|
||||
Reference in New Issue
Block a user