Sites
Conventions for every website an SVRBC project serves, whatever it’s built with or hosted on. Stack covers what a site is built with, and Hosting where it runs.
A page’s URL has no trailing slash: /about, not /about/. The site’s
own links are written that way, from the root (/about, never about or
../about), and /about/ answers with a 301 to /about, so each page has
one address for links, caches and search engines.
- On S3, a page is still built as a directory’s
index.html(about/index.html; Astro’strailingSlash: 'never'withbuild.format: 'directory'). The site’s CloudFront viewer function,router/router.js, serves/aboutfrom that file and redirects/about/. A path whose last part has a dot is a file, served as it is. - On GitLab Pages, which redirects
/aboutto/about/when it finds a directory, a page is built as a file instead (build.format: 'file', soabout.html), which Pages serves at/about. This handbook is built that way. - Why root-relative links: on a page at
/about, a relativeteamresolves to/team, not/about/team. The template’s build fails on a relative link, and on a link to a page with a trailing slash. - The special pages keep their prefix: the index is
/_, the others/_/architectureand/_/og.
svrbc-audit warns about an Astro site whose
trailingSlash is 'always'.
Page titles
Section titled “Page titles”Every site’s <title>s follow one pattern, so a tab, a bookmark or a search
result reads the same whichever SVRBC site it’s from:
| Page | <title> |
Example |
|---|---|---|
| The home page | <site name> — <tagline> |
#doreancon 2027 — The Lord Is Our Song |
| Every other page | <page> · <site name> |
Hymnal · #doreancon 2027 |
- The site name is the name the site goes by, as its header and manifest
show it, not its domain. On a multi-tenant site it’s the tenant’s:
2027.doreancon.orgis#doreancon 2027. A page may end with the manifest’sshort_nameinstead, as svrbc.org’s pages end in· SVRBC, and a page every tenant serves alike, such as/_/, with the name they share:Special pages · #doreancon. - The home page says what the site is, after an em dash: a short phrase,
not a sentence, and not
Home. It’s what a search result leads with, and what tells a stranger why to click. Keep the whole title under about 60 characters, where search results cut titles off. The page’sdescriptioncan say more. ·and—and nothing else: not|,-or:, so two separators can’t be confused and the home page never repeats the site’s name.- A count or a status goes in front, in parentheses:
(3) Prayer requests · SVRBC. It doesn’t change the rest.
In an Astro site the shared layout builds the title from the page’s own
(site.ts holds the name and tagline, as in the
template).
In a Starlight site, titleDelimiter: '·' in astro.config.mjs gives every
other page its title, and the home page sets its own in its frontmatter,
since Starlight would otherwise write the site’s name twice:
head: - tag: title content: SVRBC Developers — The developer handbooksvrbc-audit reads each site’s home page and its
/_/ and warns about a title that doesn’t follow this.
Link previews
Section titled “Link previews”Every page says how its link looks when it’s shared, with Open Graph tags: the card a link becomes in a text message, an email, a chat or a social feed. Without them each app guesses, and most show a bare URL, or whatever image they find first. Every page carries all of these:
| Tag | Content |
|---|---|
og:title |
The page’s own title, without the site’s name; the home page’s is the site’s name |
og:site_name |
The site’s name, which the apps show beside the title |
og:description |
The page’s description, word for word |
og:url |
The page’s canonical URL |
og:type |
website, or article for a page with an author and a date |
og:image |
An absolute https:// URL of a 1200×630 image |
og:image:width, og:image:height |
1200 and 630 |
og:image:alt |
What the image shows, for a reader who can’t see it |
twitter:card |
summary_large_image, so X shows the image full width too |
- One image for the whole site by default: its logo, its name and what it
is, on its own background, so a shared link is recognizably the site’s. It
is
icons/og.svg, rendered to/icons/og.pngwith the PWA’s icons, so it is built, not committed. The text is set in fonts pinned like the tools, given to librsvg through a fontconfig file that names nothing else, so it renders alike on every machine and never in whatever font a machine happens to have. - A page with a picture of its own uses it: an event’s poster, a sermon series’ art, a book’s cover. The same size and rules.
- 1200×630, PNG (or JPEG for a photo), never SVG. Facebook, LinkedIn, Slack and iMessage crop to about that shape, and none of them shows an SVG. Keep what matters away from the edges, since some crop it to a square.
- An absolute URL, on the site’s own host. Open Graph requires it, and an app that fetches the page doesn’t resolve a relative one. On a multi-tenant site, each tenant’s image is on its own host.
- A page’s description is its own. The site’s description is only the fallback; a page that has something to say says it, since its card shows that text under the title.
The tags in <head> are written where the rest are: in an Astro site, the
shared layout, from the page’s title and description; in a Starlight site,
Starlight writes all but the image, which is its head option. This
handbook is the Starlight example
(astro.config.mjs,
icons/og.svg);
the template
is the Astro one. Sites follow when someone next works on them.
The build checks them, and /_/og shows them. An astro:build:done hook,
src/og-overview.mjs, reads every page as built, fails the build on a page
that lacks a tag, whose og:url isn’t its canonical URL or whose image isn’t
a 1200×630 file in the site, and fills in /_/og: every
image, and every page’s card as an app shows it beside the tags it serves.
It reads the finished pages, not the source, so what the page shows is what
an app will see, and a page whose description is the site’s shows up there
before anyone shares it. It runs before the service worker’s stamp, which
hashes the pages as they’ll be served.
svrbc-audit reads each site’s home page and warns
about a missing tag, or an image that doesn’t load or isn’t 1200×630.
Sitemap
Section titled “Sitemap”Every site serves a /robots.txt, even one with nothing to keep
crawlers out of, and it names the site’s sitemap, which is at
/sitemap-index.xml: a Sitemap: line giving its absolute URL on the
site’s own host. The template’s is the pattern:
User-agent: *Disallow: /_/
Sitemap: https://example.svrbc.org/sitemap-index.xml- Why
/sitemap-index.xml: it’s what@astrojs/sitemapwrites (an index namingsitemap-0.xml, and the further files it splits a large site into), so an Astro site has it with no setting, and one address on every site means neither a maintainer nor a tool has to look for it. A site built otherwise serves its sitemap there too: an index, or a plain<urlset>. - Why every site has a
robots.txt: a crawler asks every host for one before it crawls, so a site without one answers each crawler with a 404, and has nowhere to name its sitemap or keep crawlers out of/_/. - Why it names the sitemap: that line is how a crawler finds a sitemap
(sitemaps.org).
/sitemap.xmlis only a guess, so a site needn’t serve one. - An absolute URL, on the host that serves the
robots.txt. The protocol requires it, and a sitemap names only pages on its own host. A bare domain that redirects towwwnameswww’s; on a multi-tenant site, each host’srobots.txtnames its own sitemap, which lists only its pages. - The special pages stay out of it, since they’re
noindex; the integration’sfilterleaves out/_/. - Every page links it too,
<link rel="sitemap" href="/sitemap-index.xml">: the template’s shared layout writes it, and Starlight writes its own.
In an Astro site it’s @astrojs/sitemap in astro.config.mjs and a
robots.txt in publicDir, as in the
template
(public/robots.txt, which svrbc-new-site gives
the site’s host) and this handbook
(static/robots.txt).
svrbc-audit warns about a site that serves no
robots.txt, whose robots.txt names no sitemap or another than
https://<host>/sitemap-index.xml, or whose /sitemap-index.xml isn’t a
sitemap.
Special pages
Section titled “Special pages”Every site serves /_/, an index of its special pages: pages about the
site, rather than its content. They’re for the people who maintain the site,
and for anyone curious how it works. Every hostname a site answers serves
them (on a multi-tenant site, every tenant), and they’re marked noindex.
Nothing on a site links to them. A site can have an “About” link, in its
footer or anywhere else, but it goes to a page of the site’s own, never to
/_/; nor does a menu item or a content page link there. The site’s
visitors are there for its content, and /_/ isn’t for them. A maintainer
reaches it by its address, which is the same on every site, or from this
handbook and svrbc-audit. The pages under /_/ link
one another, and /_/ may link back to the site’s home page.
/_/ names the commit the site was deployed from, linked to it on
GitLab (https://gitlab.com/svrbc/<project>/-/commit/<sha>), with the
release’s tag when it has one. Anyone looking at the site can then tell what
is live and read exactly the source behind it, without working it out from
pipelines. It’s the deployed commit, not the newest on master: a merge
without a release changes master but not the site.
The deploy job writes it in, not the build: the job knows the commit
($CI_COMMIT_SHA, and $CI_COMMIT_TAG for a release), and a build that
contained it would differ on every commit, so the release could never reuse
the build cached from master’s pipeline. The page carries a
placeholder that the deploy job replaces in the built files, failing if it
finds none. This handbook’s is the example:
docs/_/index.md
and the pages job in
.gitlab-ci.yml.
/_/version.json names it for tools. The same two facts, for a program
rather than a reader: {"commit": "<full SHA>", "release": "v1.2.3"}
("unreleased" for a deploy not from a tag). The build leaves it as
{"commit": "@@SOURCE_COMMIT@@", "release": "@@SOURCE_RELEASE@@"}, and the
deploy fills it in with /_/. It goes up last and is never cached
(Cache-Control: max-age=0, must-revalidate; the template’s deploy waits for
CloudFront’s invalidation first), so once it names a release, every page of
that release is live. svrbc-mr --ship waits
for it before it calls a release deployed. It’s a static file in the site
(public/_/version.json in the template,
static/_/version.json
here), not a page, so the service worker doesn’t precache it.
/_/ starts with two pages, which every site has:
/_/architecture, the architecture. How the site is built, deployed and served, with an SVG diagram: where the request goes (DNS, CDN, origin, any assets domain), how a change becomes a release, and links to the source repository and itsinfra/records. The diagram is a file in the repository, inlined into the page so it follows the site’s light or dark theme. A merge request that changes the architecture updates the diagram too./_/og, the link previews. Every link preview the site serves: each image, and each page’s card as an app shows it, with the Open Graph tags behind it. The build writes it from the finished pages.
Others get added to /_/ as a site needs them. Prefix any new one with
/_/ rather than inventing a top-level path, so it can’t collide with the
site’s own pages. Every site counts its visitors and links
analytics.svrbc.org from its /_/ rather
than showing its numbers itself.
doreancon.org’s are the example:
/_/architecture, from
src/special/
and src/assets/architecture.svg.
svrbc-audit checks that each site answers /_/,
/_/architecture and /_/og, that its home page doesn’t link them, that its /_/ links the commit it was deployed from,
and that its /_/version.json names it.
Every site is a PWA
Section titled “Every site is a PWA”Every SVRBC site is a progressive web app: it installs from the browser to a phone’s home screen or a computer’s dock, and what a reader has already seen still opens offline. Few people will install a church’s site, but the same pieces make every repeat visit faster and a bad connection (a basement classroom, a conference hall) survivable, and they cost a site a manifest, some icons and a small script.
analytics.svrbc.org is the
example of a hand-written site: site/manifest.webmanifest, site/sw.js,
icons/ and the //:icons and //:site rules in its BUILD.bazel. This
handbook is the example of an Astro one. Sites follow
when someone next works on them.
What a site serves
Section titled “What a site serves”- A web app manifest,
/manifest.webmanifest, linked from every page (<link rel="manifest">):name,short_name,id,start_urlandscope(/),display: standalone, andbackground_colorandtheme_colormatching the site’s light theme. - Icons: 192 and 512 pixel PNGs for
any, and a 512 pixelmaskableone: the logo on a solid background, inside the middle 80% circle, so a phone’s mask (circle, squircle) never cuts it. The maskable one doubles as the 180 pixelapple-touch-icon, since iOS wants no transparency. <meta name="theme-color">twice, one for each color scheme (media="(prefers-color-scheme: dark)"), so the browser’s chrome matches the page.- A service worker at
/sw.js, registered by the page’s own script.
How the service worker behaves
Section titled “How the service worker behaves”- Pages and data: network first. A reader online always gets the current page and the current numbers; offline, the copy last fetched. A page never seen before falls back to the cached home page.
- Everything else: cache first (scripts, styles, fonts, images). They change only when the site is rebuilt, and a rebuild replaces the cache.
- Versioned by the build. The build stamps
sw.jswith a hash of every other file it publishes, so any change to the site installs a new worker, which takes over at once (skipWaiting,clients.claim) and deletes the old cache. There’s no “a new version is available” prompt: the next page load is simply the new site. - Only the site’s own
GETs. Anything cross-origin (PostHog, YouTube, fonts from elsewhere) and anything that isn’t aGETgoes to the network untouched, and a site with an API never caches/api/*: an API answers for now, not for whenever the reader was last online. The one cross-origin exception is the site’s own data on a host of its own (analytics.svrbc.org’sdata.jsonon CloudFront), which is network first, like its pages. - The precache is a short list: the pages a reader needs offline and their assets, not the whole site. A site with thousands of pages (every sermon) caches what readers open, as they open it.
- Nothing else. No push notifications, no background sync, no install banner of our own (the browser offers installation itself): each would ask readers for something, and none has a use yet.
Decisions, and why
Section titled “Decisions, and why”- A hand-written service worker, no library. Workbox and the Vite and Astro plugins built on it generate one from configuration, but they trail Astro’s releases, and a plugin that doesn’t support a site’s Astro holds back its upgrades. The behavior above is a short script that anyone can read, with nothing to upgrade. Revisit if a site needs what Workbox is for (expiring caches, background sync).
- The icons are built, not committed. A Bazel step renders the PNGs from
the site’s SVGs with librsvg, pinned through
nix_tools, so the logo changes in one place. - Checked in the build, and once in a browser. The site’s own test
checks the manifest, the icon sizes, the stamp, and that every file the
worker precaches exists (a missing one fails the worker’s install, and the
site never works offline). Installability is checked in Chrome through the
DevTools Protocol:
Page.getInstallabilityErrorsanswers an empty list, and with the server stopped the pages still render, a page never seen as the home page. Stop the server: don’t emulate the network being off (Network.emulateNetworkConditions), which reaches the page but not the worker’s own fetches, so a worker that never works offline passes.
In an Astro site
Section titled “In an Astro site”This handbook (astro.config.mjs,
BUILD.bazel):
- The manifest and the worker are static files, in Astro’s
publicDir(static/here,public/by default), which the build copies as they are. - A build hook completes the worker. Astro names the files it builds by
their hashes (
/_astro/common.D5jyn-XR.css), so no list written by hand stays right. Anastro:build:donehook writes the precache list from what was built (every page and the/_astro/files) and stamps the version, as the last hook, so it hashes the pages as they’ll be served. Cache first suits those hashed files: a name never changes what it holds. - The icons are copied into
publicDirbeforeastro build, in the//:sitestep, so the stamp covers them. A plainnpm run buildhas none, so the build’s own link check passes over.pnglinks, and//:site_testchecks that the icons are there. - The tags in
<head>are Starlight’sheadoption in a documentation site, and the shared layout’s<head>otherwise.
Several hosts from one build (doreancon.org’s years, the study sites of svrbc/symbolics-sites): each host is its own origin and installs its own app, so each has its own manifest, with its own name and icons, and its own service worker, each written into that host’s directory at build time.
svrbc-audit warns about a site that links no
manifest, whose manifest lacks a name, start URL, standalone display or the
192, 512 and maskable icons, or that registers no service worker.
Pressed states
Section titled “Pressed states”A button that changes when hovered changes when pressed, too. A touch screen has no hover: a tap there shows only the active state, so a button with a hover style and no active one gives no sign it was touched, and a visitor taps again. On a desktop the same press is what tells someone the click landed. Designs, and the agents that write them, add the hover and forget the press.
- What counts as a button: a
<button>, anything withrole="button", a submit input or a<summary>, and anything whose hover changes more than its text, such as a link drawn as a button or a card that lifts. A text link whose hover only colors or underlines it needs nothing more. Neither does a field (select,input,textarea) or a table row lit up for reading. - In Tailwind, the class string that holds
hover:holdsactive:too: usually a step past the hover (hover:bg-surface-muted active:bg-surface-strong), or a slight press (active:scale-[0.98],active:translate-y-px). On a card that lifts on hover, press it back down. Or one stylesheet rule presses every button of a kind, on a class they all have (.text-muted:active, as the study sites do), and the class strings need noactive:of their own. - In CSS, every
X:hoverhas anX:active, or the rule saysX:is(:hover, :active). - Keep the press quick. A tap lasts a fraction of a second, so a
300ms
transitionshows only a hint of it before it eases back. Give the active state 100ms or less, or no transition.
svrbc-audit reads each project’s markup and
stylesheets and warns about a button with a hover state and no active one;
svrbc-audit --press-states <checkout> lists every one in a checkout, and
exits 1 when it finds any, so a site can run it as a test.
A load-time budget
Section titled “A load-time budget”Every site holds its pages to a budget, and its build fails a page over it. A page gets heavier a little at a time (a font, a widget, a library for one feature), and no single change looks like the one that made it slow; a number the build checks catches each change as it is made. The numbers are what a visitor’s phone downloads before the page is usable, gzipped, as CloudFront serves them:
| HTML | JS | CSS | Requests | |
|---|---|---|---|---|
| An ordinary page (the default) | 60 kB | 25 kB | 20 kB | 10 |
- Each kind of page has its own line. A site whose home page or long documents are bigger by nature gives them a line of their own, matched by path, rather than raising the limit for every page. The default is symbolics-sites’ study page (svrbc/symbolics-sites#25), which keeps its whole-document pages to 250 kB of HTML.
- What counts. HTML is the page itself; JS its inline scripts and the
ones it loads: script tags, its islands’ components and renderers, and
every module those import, to the end (a dynamic
import()loads later, and isn’t counted); CSS its inline styles and stylesheets; requests, what it loads before it is usable: stylesheets, all those scripts, and the Latin fonts its stylesheets use. Images aren’t counted: they load lazily and don’t keep a page from being read. The special pages (/_/) are for maintainers, and aren’t held to it. - Raising a limit is a decision, recorded in the issue that asks for it (and the line in the table points to it), not a way to make the test pass. A page over its budget is first a page to make lighter.
- Islands split into many small chunks. Vite’s own splitting gives a
page with Solid islands a dozen or two files of a few hundred bytes, each
a request. Group them (
vite.build.rolldownOptions.output.codeSplitting): the modules every page shares in one chunk, and the islands’ framework and shared components in another. Leave Astro’s page scripts out of a group (their module IDs carry?astro&type=script): grouped, every page runs every other page’s scripts. doreanpress.org’sastro.config.mjs(#1) does this. - The test is
//:budget_test, a Bazel test over//:site’s tarball: the template’sscripts/bazel/budget_test.sh, with the table at its top for each site to change. It prints the heaviest pages of each kind, and writes every page’s numbers tobudget.jsonamong its outputs (bazel-testlogs/budget_test/test.outputs/), so two releases can be compared. A site with a router or several hosts (symbolics-sites’budget_test.sh) sorts its pages into kinds its own way. - Timing is a separate test, where a site wants one. Weight is
deterministic and cheap to check on every build; load time isn’t.
symbolics-sites’
//:perf_testtimes a page of each kind (LCP, CLS and TBT on a throttled phone) in a headless Chromium, as an exclusive, flaky test. The budget is what every site has.
The handbook holds itself to the default with the same script.
svrbc-audit warns about a site built by Bazel that
has no //:budget_test.
Analytics
Section titled “Analytics”Every site counts its visitors, with PostHog, without cookies. Every SVRBC site follows this, so every site’s numbers live in one place, read the same way, and none of them needs a consent banner.
-
One PostHog project for every site,
sites, in SVRBC’s organization on PostHog’s US cloud (us.posthog.com), on the free plan. PostHog records the host on every event, so a breakdown by$hostsplits the sites (and a multi-tenant site’s tenants), and every site uses the same key:posthog.init('phc_rHc6WofJM9x8MqQjHpnUrxqzJAUPbSiBuWSTrbLq3Pbn', {api_host: 'https://us.i.posthog.com',defaults: '2026-08-30',cookieless_mode: 'always',person_profiles: 'identified_only',}) -
One project, so the free plan. It allows one project per organization (
organizations_projects, limit 1); its monthly allowance of events is on the billing page, beside what the sites use. A project per site would need the pay-as-you-go plan (a card on file) for nothing a$hostfilter doesn’t already give. Decided 2026-10-07. A site that ever needs its own (other people’s access, its own retention) is the time to upgrade. -
Cookieless, always.
posthog-jsruns withcookieless_mode: 'always': no cookies, no local or session storage, so nothing that calls for a consent banner. PostHog tells visitors apart by a hash it computes on its servers, which resets daily, so a returning visitor counts again the next day. The project has to allow it (Settings → Web analytics → Cookieless server hash mode, orcookieless_server_hash_mode: 2through the API); without that PostHog drops every cookieless event, silently. -
No session replay, nor anything else that needs browser storage. Clicks are autocaptured, and pageviews follow the router (
defaults: '<date>'turns oncapture_pageview: 'history_change'). To name a button in the reports, give it adata-ph-capture-attribute-*attribute rather than writingposthog.capture()calls. -
Or a pageview of the site’s own, when posthog-js won’t fit. posthog-js is tens of kilobytes; a site held to a tight JavaScript budget can send its pageviews itself instead: once the page has loaded, one
POSTtohttps://us.i.posthog.com/i/v0/e/with the shared key,event: '$pageview',distinct_id: '$posthog_cookieless'and the properties$cookieless_mode: true,$current_url,$host,$pathname,$referrerand$raw_user_agent, which is what posthog-js’s cookieless events carry, so PostHog hashes them the same way, and$device_type(Mobile,TabletorDesktop, from the user agent), which posthog-js works out in the browser and PostHog doesn’t, so without it the visit is missing from analytics.svrbc.org’s Devices list. Pageviews only: no autocaptured clicks. symbolics-sites does this (itssrc/analytics.ts), sending only from its real hosts, as does analytics.svrbc.org itself (itssite/analytics.js). -
Nothing is sent from local development: the client skips initialization in dev builds, so the numbers are visitors’.
-
No secrets. The project API key (
phc_…) can only send events, and is meant to be public, so it goes in the site’s committed config, like Nuxt’sruntimeConfig.public. -
analytics.svrbc.org shows them all, in one place, with a filter for each site and host (
svrbc/analytics.svrbc.org). A site is its registrable domain, so a new site appears there by itself, with nothing to add. A site links it from its/_/(?site=<domain>opens on its own numbers); it doesn’t embed a dashboard of its own, and doesn’t need a/_/analytics. -
It draws its own charts rather than embedding PostHog’s: an embed can’t be styled to match, and viewers can’t filter it. Every hour a Lambda function asks PostHog’s query API for the numbers, with a personal API key that can only read (Query: Read, kept in SSM Parameter Store), and writes them to
data.json, which the page reads from CloudFront (Releases,infra/analytics-svrbc-org-data/). -
The numbers are public. Visitor counts for SVRBC’s sites aren’t sensitive, so analytics.svrbc.org is a public, developer-facing Pages site, and its
data.jsonis public on CloudFront. If they ever had to be private, Pages access control alone wouldn’t do it: the data would have to move behind it too. -
The project has no public dashboards. PostHog’s own dashboards are for its signed-in members; none is shared publicly.
doreancon.org is the example of a site that counts its visitors:
src/components/Analytics.astro.
One thing trips up a new project, should SVRBC ever make another:
- A new project’s dashboards sit behind PostHog’s onboarding screen,
which returns on every visit until onboarding is marked done. Skipping
through it doesn’t always stick; marking it done through the API does:
PATCH /api/environments/<id>/with{"has_completed_onboarding_for": {"product_analytics": true, "web_analytics": true}}.
svrbc-audit checks that every site is on
analytics.svrbc.org (its host is in data.json, so it has sent
the shared project events lately), that a project using posthog-js
runs it cookieless and sends to the shared project, and warns about other
analytics packages.