-site (or KHOSRA_SITE) opens the site root through content.OpenSite, so every
read keeps the os.Root guarantee. A path is a bundle key: /{section}/{slug}/
serves, the slashless form redirects permanently to it (ADR-0008), anything
unknown is 404. Render failure logs and returns a bare 500 rather than leaking a
template or filesystem detail.
internal/render holds goldmark plus the embedded reference theme (ADR-0026):
base.html with a redefinable "main" block, and one stylesheet inlined through
.Style. Serving it at an asset route would have been a second routing case for no
gain, and static serving belongs to a later entry.
Evidence beyond the tests: the binary against a real site root returns 200 with
<h1>About</h1> and the rendered body, 301 from /pages/about to /pages/about/, and
404 for /nope/. A Bengali variant is scanned but not yet reachable — that is the
next entry.
theme-contract.md gains a "Live today" section listing the six fields and two
named templates a theme may now rely on; the rest stays marked as shape.
22 lines
405 B
HTML
22 lines
405 B
HTML
{{define "base" -}}
|
|
<!doctype html>
|
|
<html lang="{{.Lang}}">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>{{if .Title}}{{.Title}}{{else}}{{.Key}}{{end}}</title>
|
|
<style>{{.Style}}</style>
|
|
</head>
|
|
<body>
|
|
<main>
|
|
{{block "main" . -}}
|
|
<article>
|
|
{{if .Title}}<h1>{{.Title}}</h1>{{end}}
|
|
{{.HTML}}
|
|
</article>
|
|
{{- end}}
|
|
</main>
|
|
</body>
|
|
</html>
|
|
{{- end}}
|