Files
cdnutterandClaude Opus 5.5 06097d3bca Add an optional site password for visitors
Settings → Privacy can set a password for the whole public site. Until a
visitor enters it, every public page shows a prompt over a blurred
made-up page, and images, preview clips and exports return 401; nothing
real is sent. Unlocking sets a 90-day cookie derived from the password
hash, so changing the password asks everyone again. The owner is never
asked while signed in. Wrong guesses are rate limited, and a locked site
sends noindex.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 15:47:17 -07:00

62 lines
2.5 KiB
HTML

<!doctype html>
<html lang="en" data-theme="{{.Site.Theme}}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{if .PageTitle}}{{.PageTitle}} · {{end}}{{.Site.Title}}</title>
{{- if ne .Page "gate"}}
<meta name="description" content="{{if .Site.Tagline}}{{.Site.Tagline}}{{else}}{{.Site.Title}}: a ranked collection of favorites{{end}}">
{{- else}}
<meta name="robots" content="noindex, nofollow">
{{- end}}
<meta property="og:title" content="{{if .PageTitle}}{{.PageTitle}} · {{end}}{{.Site.Title}}">
<link rel="icon" href="/static/img/favicon.svg" type="image/svg+xml">
<link rel="stylesheet" href="/static/css/themes.css?v={{.AssetVer}}">
<link rel="stylesheet" href="/static/css/app.css?v={{.AssetVer}}">
{{- if .Site.CustomCSS}}
<link rel="stylesheet" href="/custom.css?v={{.Site.CSSVersion}}">
{{- end}}
</head>
<body class="{{block "bodyclass" .}}{{end}}">
<a class="skip-link" href="#main">Skip to content</a>
{{- /* The bar only holds the owner's links, so visitors never see it. */}}
{{- if and .LoggedIn (ne .Path "/")}}
{{template "topbar" .}}
{{- else if .LoggedIn}}
{{- /* The home page is the public face, so even signed in the bar stays
tucked away behind a small tab until it's wanted. */}}
<details class="topbar-drawer">
<summary class="topbar-tab" aria-label="Show menu" title="Menu">{{icon "chevron-down"}}</summary>
{{template "topbar" .}}
</details>
{{- end}}
<main id="main">
{{block "content" .}}{{end}}
</main>
{{- if ne .Page "gate"}}
<footer class="footer">
<div class="container footer-inner">
<span>{{if .Site.OwnerName}}Curated by {{.Site.OwnerName}}{{else}}{{.Site.Title}}{{end}}</span>
<span class="footer-sep" aria-hidden="true">·</span>
<span>Powered by <a href="https://git.iamchrisama.com/cdnutter/canon" rel="noopener">Canon</a></span>
</div>
</footer>
{{- end}}
{{block "scripts" .}}{{end}}
</body>
</html>
{{define "topbar"}}
<header class="topbar">
<div class="topbar-inner container">
<nav class="topnav" aria-label="Admin">
<a href="/admin"{{if or (eq .Path "/admin") (hasPrefix .Path "/admin/lists")}} aria-current="page"{{end}}>{{icon "list"}}<span>Lists</span></a>
<a href="/admin/settings"{{if eq .Path "/admin/settings"}} aria-current="page"{{end}}>{{icon "settings"}}<span>Settings</span></a>
<form method="post" action="/logout" class="topnav-form">
<button type="submit" class="topnav-btn" title="Sign out ({{.Username}})">{{icon "logout"}}<span class="sr-only">Sign out</span></button>
</form>
</nav>
</div>
</header>
{{end}}