ReviewOS

also looking at this

stacks/bench-review

Adopt the hq-apps app conventions

#76
Merged glennmichael123 wants to merge chore/hq-apps-conventions into main
31 files +1656 -395
app/Helpers/sitemap.tsmodified+14-1
Changes to app/Helpers/sitemap.ts
@@ -1,4 +1,5 @@
11import { db } from '@stacksjs/database'
2import site from '~/site.config'
23
34/**
45 * Shared sitemap + robots builders.
@@ -29,11 +30,23 @@ const STATIC_PATHS: Array<{ path: string, priority: number, changefreq: string }
2930 { path: '/register', priority: 0.5, changefreq: 'yearly' },
3031]
3132
32/** Normalize a base URL: trim trailing slashes so `${base}${path}` is clean. */
33/**
34 * Normalize a base URL: trim trailing slashes so `${base}${path}` is clean.
35 *
36 * The fallback is deliberately the LOCAL dev host, not the production
37 * canonical: a build with APP_URL unset must produce an obviously-local
38 * artifact that the conformance gate rejects ("APP_URL unset — artifact
39 * carries N loopback URLs"), rather than a plausible-looking one that
40 * silently claims to be production. `site.url` is the canonical host and is
41 * what you get once APP_URL is set; see DEPLOY.md.
42 */
3343export function normalizeBase(raw: string | undefined): string {
3444 return (raw || 'http://localhost:4000').replace(/\/+$/, '')
3545}
3646
47/** The production canonical origin, from site.config.ts. */
48export const CANONICAL_BASE: string = site.url.replace(/\/+$/, '')
49
3750/**
3851 * Build the full sitemap XML from current DB content. Every judge gets a
3952 * /judges/:id/profile entry, every courthouse /court-houses/:id/profile,