repos
/ orchard main

orchard

mirror

Every site I host, in one repo, along with the Cloudflare Tunnel and Caddy that front them. It's all Go, Vite, and SQLite, and it runs on a desktop at home with nothing listening on an inbound port.

blogbuncaddycloudflare-tunneldockergogolanghomelabhtml-templatemonorepoself-hostedseosqlitestatic-sitetypstuptime-monitoringviteweb-analytics

4.3 KB · 125 lines · HTML Raw History
  1{{define "base.html"}}<!doctype html>
  2<html lang="en">
  3<head>
  4<meta charset="utf-8">
  5<meta name="viewport" content="width=device-width, initial-scale=1">
  6<title>{{if .Title}}{{.Title}} &middot; {{end}}{{.SiteName}}</title>
  7{{if .Description}}<meta name="description" content="{{.Description}}">{{end}}
  8{{if .Staging}}<meta name="robots" content="noindex, nofollow">{{end}}
  9<link rel="canonical" href="{{.Canonical}}">
 10<link rel="icon" href="/favicon.svg" type="image/svg+xml">
 11{{range .Styles}}<link rel="stylesheet" href="{{.}}">{{end}}
 12{{- if .Analytics}}
 13<script>
 14  (function (m, e, t, r, i, c, s) {
 15    m.collectorQueue = m.collectorQueue || r;
 16    m.collectorServer = c;
 17    m.collectorId = s;
 18    m.collectorScript = e.createElement(t);
 19    m.collectorScript.src = c + i;
 20    e.head.appendChild(m.collectorScript);
 21  })(window, document, "script", [], "/static/collector.js",
 22     "https://analytics.bythewood.me", "{{.AnalyticsID}}");
 23</script>
 24{{- end}}
 25</head>
 26<body>
 27
 28<header class="topbar">
 29  <div class="wrap">
 30    <a class="brand" href="/">{{template "mark"}} repos</a>
 31
 32    {{/*
 33      Context, not decoration. Below the index this says which repository you
 34      are in, so the header answers a question instead of repeating the site
 35      name at you.
 36    */}}
 37    <div class="context">
 38      {{if .RepoName}}
 39        <span class="sep">/</span>
 40        <span class="here"><a href="/{{.RepoName}}">{{.RepoName}}</a></span>
 41        {{if .RepoRev}}<span class="ref">{{.RepoRev}}</span>{{end}}
 42      {{else if .Crumb}}
 43        <span class="sep">/</span>
 44        <span class="here">{{.Crumb}}</span>
 45      {{end}}
 46    </div>
 47
 48    <nav>
 49      {{if .LoggedIn}}
 50        <a href="/settings">Settings</a>
 51        <a href="https://auth.bythewood.me/">Account</a>
 52      {{else}}
 53        <a href="/login">Sign in</a>
 54      {{end}}
 55    </nav>
 56  </div>
 57</header>
 58
 59{{block "hero" .}}{{end}}
 60
 61<main class="wrap">
 62{{template "content" .}}
 63</main>
 64
 65<footer class="footer">
 66  <div class="wrap">
 67    <div class="cols">
 68      <div class="about">
 69        <div class="h5">// {{.SiteName}}</div>
 70        {{/*
 71          Says what the site is for and nothing about how it is built or where
 72          it runs. None of that helps a visitor and all of it narrows an
 73          attacker's guesswork.
 74        */}}
 75        <p>{{.AuthorName}}'s code, kept and served here. Clone anything, browse the history.</p>
 76      </div>
 77
 78      <div>
 79        <div class="h5">// Elsewhere</div>
 80        <ul>
 81          <li><a href="https://isaacbythewood.com/">Portfolio</a></li>
 82          <li><a href="https://blog.bythewood.me/">Blog</a></li>
 83          <li><a href="https://github.com/overshard" target="_blank" rel="noopener">GitHub</a></li>
 84        </ul>
 85      </div>
 86
 87      <div>
 88        <div class="h5">// Pages</div>
 89        <ul>
 90          <li><a href="/">All repositories</a></li>
 91          <li><a href="{{.SourceURL}}" target="_blank" rel="noopener">Source</a></li>
 92        </ul>
 93      </div>
 94
 95      <div>
 96        <div class="h5">// Operator</div>
 97        <ul>
 98          {{if .LoggedIn}}
 99          <li><a href="/settings">Push tokens</a></li>
100          <li><a href="https://auth.bythewood.me/">Account</a></li>
101          {{else}}
102          <li><a href="/login">Sign in</a></li>
103          {{end}}
104        </ul>
105      </div>
106    </div>
107  </div>
108</footer>
109
110<div class="footer-bar">
111  <div class="wrap">
112    <small>&copy; {{.Year}} {{.AuthorName}} &middot; Some rights reserved</small>
113    <a href="{{.SourceURL}}" target="_blank" rel="noopener" class="footer-bar-link" aria-label="GitHub">
114      <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16">
115        <path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"/>
116      </svg>
117    </a>
118  </div>
119</div>
120
121{{if .Script}}<script type="module" src="{{.Script}}"></script>{{end}}
122</body>
123</html>
124{{end}}