| 1 | {{ define "layout" -}} |
| 2 | <!DOCTYPE html> |
| 3 | <html lang="en" data-theme="auto"> |
| 4 | <head> |
| 5 | <script> |
| 6 | // Theme flash avoidance: read the cookie or system preference and apply |
| 7 | // before any CSS computes. The four themes are: light, dark, auto, |
| 8 | // high-contrast (S10 wires the picker; S02 just enforces the contract). |
| 9 | (function () { |
| 10 | var match = document.cookie.match(/(?:^|; )theme=([^;]+)/); |
| 11 | var theme = match ? decodeURIComponent(match[1]) : "auto"; |
| 12 | if (theme === "auto") { |
| 13 | theme = matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"; |
| 14 | } |
| 15 | document.documentElement.setAttribute("data-theme", theme); |
| 16 | })(); |
| 17 | </script> |
| 18 | <meta charset="UTF-8"> |
| 19 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 20 | <meta name="color-scheme" content="light dark"> |
| 21 | <meta name="description" content="shithub — GitHub. Open source. Without Copilot."> |
| 22 | {{ if .OGTitle }}<meta property="og:title" content="{{ .OGTitle }}">{{ end }} |
| 23 | {{ if .OGDescription }}<meta property="og:description" content="{{ .OGDescription }}">{{ end }} |
| 24 | {{ if .OGImage }}<meta property="og:image" content="{{ .OGImage }}">{{ end }} |
| 25 | <title>{{ .Title }} · shithub</title> |
| 26 | <link rel="icon" type="image/svg+xml" href="/static/logo/favicon.svg"> |
| 27 | <link rel="stylesheet" href="/static/primer/primer.css" onerror="this.remove()"> |
| 28 | <link rel="stylesheet" href="/static/css/shithub.css"> |
| 29 | <link rel="stylesheet" href="/static/css/chroma.css"> |
| 30 | </head> |
| 31 | <body class="shithub-body"> |
| 32 | {{ template "nav" . }} |
| 33 | <main class="shithub-main"> |
| 34 | {{ template "page" . }} |
| 35 | </main> |
| 36 | {{ template "footer" . }} |
| 37 | </body> |
| 38 | </html> |
| 39 | {{- end }} |