Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion OPERATIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ The maps are generated by [`capture/build-redirects.py`](./capture/build-redirec

The bundle also carries `viljoen.family`, a single static page whose source is [`sites/viljoen.family/`](./sites/viljoen.family/). `make-release.sh` copies it to `family/` beside `site/`, leaving out its README, and precompresses it the same way. It shares the release, the containers, and the rollback with the blog, so a family change ships as a blog release.

A second site block in `deploy/Caddyfile` serves it on the same port, selected by the `Host` header the proxy forwards. Any other hostname falls through to the blog's `:8080` block, so the blog's redirects never answer on the family host. The family block carries its own security headers and CSP, and answers a missing path with the page itself at a `404` status.
A second site block in `deploy/Caddyfile` serves it on the same port, selected by the `Host` header the proxy forwards. Any other hostname falls through to the blog's `:8080` block, so the blog's redirects never answer on the family host. The family block carries its own security headers and CSP, and answers a missing path with the page itself at a `404` status. It also routes the page's two languages: `/` redirects to `/af/` for a browser whose first language is Afrikaans, while `/en/` and `/af/` never redirect.

**A rollback to a release older than the family block drops it.** Every hostname then reaches the blog block, so `viljoen.family` serves the blog, indexable on production, until a release carrying the block is live again.

Expand Down
30 changes: 26 additions & 4 deletions deploy/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -137,21 +137,43 @@ http://viljoen.family:8080, http://viljoen.vps.insanegenius.net:8080 {
Strict-Transport-Security "max-age=31536000"
X-Content-Type-Options "nosniff"
Referrer-Policy "strict-origin-when-cross-origin"
Content-Security-Policy "default-src 'self'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src https://fonts.gstatic.com; connect-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com; script-src 'self' 'unsafe-inline'; img-src 'self' data:"
Content-Security-Policy "default-src 'self'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src https://fonts.gstatic.com; connect-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com; script-src 'self'; img-src 'self' data:"
}

@svg path *.svg
header @svg Cache-Control "public, max-age=604800"
@code path *.css *.js
header @code Cache-Control "no-cache"

# The root follows the browser's first language, and /en/ and /af/ never redirect, so the language switch always holds.
@af_first {
path /
header_regexp Accept-Language `(?i)^\s*af(-[a-z0-9]+)*\s*(,|$|;\s*q\s*=\s*(1|0?\.0*[1-9]))`
}
header / +Vary Accept-Language
redir @af_first /af/{?query} 302
redir /en /en/ 308
redir /af /af/ 308
Comment thread
ptr727 marked this conversation as resolved.
Resolved
rewrite /en/ /index.html

file_server {
precompressed br gzip
}

# A single-page site has nowhere better to send a stray path than the page itself.
handle_errors {
rewrite * /index.html
file_server {
precompressed br gzip
@af_page path /af/*
handle @af_page {
rewrite * /af/index.html
file_server {
precompressed br gzip
}
}
handle {
rewrite * /index.html
file_server {
precompressed br gzip
}
}
}

Expand Down
22 changes: 17 additions & 5 deletions sites/viljoen.family/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,18 @@ The single-page genealogy site for the Viljoen family, served at `viljoen.family
- [Page Design](#page-design)
- [How the Tree Is Drawn](#how-the-tree-is-drawn)
- [Facts on the Page and Their Sources](#facts-on-the-page-and-their-sources)
- [Languages](#languages)
- [Local Preview](#local-preview)
- [Ideas Not Yet Done](#ideas-not-yet-done)

## Files

| File | What it is |
| --- | --- |
| `index.html` | The whole page, with inline CSS and the inline tree-drawing script |
| `index.html` | The English page, served at `/` and `/en/` |
| `af/index.html` | The Afrikaans page, served at `/af/` |
| `site.css` | The styles both pages share |
| `site.js` | The tree-drawing script both pages share |
| `crest.svg` | The full achievement (crest, helm, mantling, shield, name scroll), viewBox 336x418 |
| `favicon.svg` | The shield alone, cut from `crest.svg` |
| `apple-touch-icon.png` | 180x180, `favicon.svg` on parchment |
Expand Down Expand Up @@ -50,7 +54,7 @@ The arms derive from the French family Villon de Varennes, whose crest was a gol
- **Frame:** a 2.5px red border plus an inner 1px gold rule (`.frame::before`) with rounded corners and four gold corner flourishes (`#corner` symbol). A negative margin on the masthead equals the frame's top margin (128px, or 96px on phones). That puts the top border behind the mantling, so change both values together.
- **Paper texture:** an inline SVG `feTurbulence` noise data URI plus a radial vignette on `html`.
- **Divider:** a simplified Huguenot cross (a Maltese cross with fleur points, balls on the tips, and a hanging dove), the `#huguenot-cross` symbol.
- **CSP:** the policy in `deploy/Caddyfile` allows `'unsafe-inline'` for scripts and styles because both are inline. Moving them to `site.css` and `site.js` lets the policy drop it. Test in a browser after any CSP change, because a blocked script fails silently and the tree simply does not draw.
- **CSP:** the policy in `deploy/Caddyfile` allows only `'self'` for scripts, since the one script is `site.js`. Styles keep `'unsafe-inline'` for the `style` attributes and the `<style>` block the script writes into the tree's SVG. Test in a browser after any CSP change, because a blocked script fails silently and the tree simply does not draw.
- **Browser support:** the page uses `color-mix()`. Older browsers lose some tints, and the layout is unaffected.

## How the Tree Is Drawn
Expand All @@ -62,7 +66,7 @@ The tree is a stamboom. The children form the crown, and the stamouers card sits
- **Numbering and signs:** SAG de Villiers/Pama numbering (`a`, `b1` to `b6`, `b3c4`). The signs are `*` born, `~` baptized, `x` married (`x1`, `x2` for successive marriages), and a dagger for died. Each is an HTML entity inside `<abbr title>`, hidden from screen readers. On the cards a visually hidden word stands in for the sign. The legend under the tree already spells each word out, so its signs carry no hidden word. Dates use the SAG `dd.mm.yyyy` form.
- **Living people:** none are published. Only people born before about 1925 are shown.

The script at the bottom of `index.html` measures the couple card, the soil band, the child cards, and the stubs, then fills `svg.branches` inside `.tree`:
`site.js` measures the couple card, the soil band, the child cards, and the stubs, then fills `svg.branches` inside `.tree`:

- Each limb is a cubic Bezier drawn as a filled shape that tapers from width `w0` to `w1` (`limb()`), not as a stroke.
- Leaves sprout at chosen positions along a limb, alternating sides (`leaves()`). The pattern is fixed rather than random, so every redraw looks the same. About one leaf in five is gold.
Expand All @@ -85,15 +89,23 @@ The script at the bottom of `index.html` measures the couple card, the soil band
- **Still to verify** against the Familiebond's Familieregister (4 volumes, about 2,000 pages): all of the above. That includes the claim that the Viljoen name was carried forward through Henning and Johannes.
- **MyHeritage and Geni** returned nothing to automated fetches, and their content has not been reviewed.

## Languages

The page exists in English and Afrikaans, as two HTML files that share `site.css`, `site.js`, and every image.

- **Choosing the language.** Caddy redirects `/` to `/af/` when Afrikaans is the browser's first `Accept-Language`, and sends `Vary: Accept-Language`. The `/en/` and `/af/` addresses never redirect, so a visitor's choice holds.
- **The switch.** A link in the corner, or under the crest on phones, leads to the other language's explicit address. Both pages carry `hreflang` alternates and their own canonical URL.
- **Keeping them in step.** `af/index.html` is a translation of `index.html` with the same markup. A change to one page's structure goes into the other in the same commit. The CSS names the one string it carries, the "Viljoen line" badge, per language with `:lang(af)`.
- **Mixed text.** English left on the Afrikaans page, such as the blazon and the English site names, carries `lang="en"`.

## Local Preview

Serve the directory with any static server, for example `python3 -m http.server 8765 --bind 127.0.0.1 --directory sites/viljoen.family`. A phone viewport (375px) shows no horizontal overflow and no console errors.
Serve the directory with any static server, for example `python3 -m http.server 8765 --bind 127.0.0.1 --directory sites/viljoen.family`. A phone viewport (375px) shows no horizontal overflow and no console errors. A static server serves `/af/` directly. The language redirect, the `/en/` address the Afrikaans switch links to, and the CSP need Caddy.

## Ideas Not Yet Done

- Self-hosted fonts instead of Google Fonts, for privacy and a shorter CSP.
- The c generation on the tree, starting with the Henning and Johannes lines, in place of the stubs.
- An Afrikaans version of the page, or a language toggle (headings already carry Afrikaans subtitles).
- A contact line or a Familiebond membership link in the footer.

<!-- Local files -->
Expand Down
Loading
Loading