Initial scaffold: Hugo site for west575.org

Blog with contact form and newsletter signup, structured like the
other Reground-hosted sites but with its own visual identity.
This commit is contained in:
2026-08-27 05:28:14 -04:00
commit 19034a026e
17 changed files with 672 additions and 0 deletions
+31
View File
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="{{ .Site.Language.LanguageCode | default "en" }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ .Title }} · {{ .Site.Title }}{{ end }}</title>
<meta name="description" content="{{ .Site.Params.description }}">
<link rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" href="{{ "index.xml" | absURL }}">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600&family=Work+Sans:wght@400;500;600&display=swap">
{{ $css := resources.Get "css/main.css" }}
{{ if hugo.IsProduction }}
{{ $css = $css | minify | fingerprint }}
<link rel="stylesheet" href="{{ $css.RelPermalink }}" integrity="{{ $css.Data.Integrity }}">
{{ else }}
<link rel="stylesheet" href="{{ $css.RelPermalink }}">
{{ end }}
</head>
<body>
<a class="skip-link" href="#main-content">Skip to content</a>
{{ partial "header.html" . }}
<main id="main-content">
{{ block "main" . }}{{ end }}
</main>
{{ partial "footer.html" . }}
</body>
</html>
+60
View File
@@ -0,0 +1,60 @@
{{ define "main" }}
<h1>Get in touch</h1>
<p class="lede">Questions, corrections, or just want to say hi — I read every message myself.</p>
<form id="contact-form" class="contact-form">
<label for="name">Name</label>
<input type="text" id="name" name="name" required autocomplete="name">
<label for="email">Email</label>
<input type="email" id="email" name="email" required autocomplete="email">
<label for="message">Message</label>
<textarea id="message" name="message" rows="6" required></textarea>
<div class="field-honeypot" aria-hidden="true">
<label for="website">Leave this field empty</label>
<input type="text" id="website" name="website" tabindex="-1" autocomplete="off">
</div>
<button type="submit" class="btn">Send message</button>
</form>
<p id="contact-status" role="status" class="contact-status"></p>
<script>
(function () {
var form = document.getElementById("contact-form");
var status = document.getElementById("contact-status");
form.addEventListener("submit", function (e) {
e.preventDefault();
if (form.website.value) return; // honeypot
var payload = {
name: form.name.value,
email: form.email.value,
message: form.message.value
};
var submitBtn = form.querySelector("button[type=submit]");
submitBtn.disabled = true;
status.textContent = "Sending…";
fetch("{{ .Site.Params.eec_base_url }}/contact", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(payload)
}).then(function (res) {
submitBtn.disabled = false;
if (res.ok) {
form.reset();
status.textContent = "Thanks — I'll get back to you soon.";
return;
}
return res.text().then(function (msg) {
status.textContent = msg || "Something went wrong sending that. Try again, or email will@west575.org directly.";
});
}).catch(function () {
submitBtn.disabled = false;
status.textContent = "Something went wrong sending that. Try again, or email will@west575.org directly.";
});
});
})();
</script>
{{ end }}
+14
View File
@@ -0,0 +1,14 @@
{{ define "main" }}
<h1>{{ .Title }}</h1>
{{ .Content }}
<ul class="post-list">
{{ range .Pages }}
<li class="post-list-item">
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
{{ if not .Date.IsZero }}
<span class="post-date">{{ .Date.Format "January 2, 2006" }}</span>
{{ end }}
</li>
{{ end }}
</ul>
{{ end }}
+21
View File
@@ -0,0 +1,21 @@
{{ define "main" }}
<article class="post">
<header class="post-header">
<h1>{{ .Title }}</h1>
{{ if not .Date.IsZero }}
<p class="post-meta">
<time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "January 2, 2006" }}</time>
{{ with .Params.tags }}
<span class="post-tags">
{{ range . }}<span class="post-tag">{{ . }}</span>{{ end }}
</span>
{{ end }}
</p>
{{ end }}
</header>
<div class="post-body">
{{ .Content }}
</div>
</article>
{{ end }}
+25
View File
@@ -0,0 +1,25 @@
{{ define "main" }}
<section class="hero">
<h1>{{ .Title }}</h1>
{{ .Content }}
</section>
<section class="home-recent">
<h2>Recent posts</h2>
<ul class="post-list">
{{ range first 5 (where .Site.RegularPages "Section" "posts") }}
<li class="post-list-item">
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
<span class="post-date">{{ .Date.Format "January 2, 2006" }}</span>
</li>
{{ end }}
</ul>
<p><a href="/posts/">All posts &rarr;</a></p>
</section>
<section class="home-subscribe">
<h2>Stay in the loop</h2>
<p>New posts land here first, and occasionally by email.</p>
{{ partial "subscribe-form.html" . }}
</section>
{{ end }}
+19
View File
@@ -0,0 +1,19 @@
<footer class="site">
<div class="inner">
<div class="footer-top">
<div class="footer-about">
<span>&copy; {{ now.Year }} {{ .Site.Params.author | default .Site.Title }}</span>
<nav aria-label="Footer">
{{ range .Site.Menus.footer }}
<a href="{{ .URL }}">{{ .Name }}</a>
{{ end }}
<a href="{{ "index.xml" | absURL }}">RSS</a>
</nav>
</div>
<div class="footer-subscribe">
<p class="footer-subscribe-label">Get new posts by email, occasionally.</p>
{{ partial "subscribe-form.html" . }}
</div>
</div>
</div>
</footer>
+10
View File
@@ -0,0 +1,10 @@
<header class="site">
<div class="inner">
<a class="brand" href="/">{{ .Site.Title }}</a>
<nav aria-label="Primary">
{{ range .Site.Menus.main }}
<a href="{{ .URL }}"{{ if $.IsMenuCurrent "main" . }} aria-current="page"{{ end }}>{{ .Name }}</a>
{{ end }}
</nav>
</div>
</header>
+51
View File
@@ -0,0 +1,51 @@
{{/* Standalone newsletter signup — not tied to any ARC/giveaway flow.
Posts a JSON body to {eec_base_url}/subscribe. Include anywhere with
{{ partial "subscribe-form.html" . }}. */}}
{{ $id := printf "subscribe-%d" (now.UnixNano) }}
<form id="{{ $id }}" class="subscribe-form">
<label for="{{ $id }}-email" class="sr-only">Email address</label>
<input type="email" id="{{ $id }}-email" name="email" required autocomplete="email" placeholder="you@example.com">
<div class="field-honeypot" aria-hidden="true">
<label for="{{ $id }}-website">Leave this field empty</label>
<input type="text" id="{{ $id }}-website" name="website" tabindex="-1" autocomplete="off">
</div>
<button type="submit" class="btn btn-subscribe">Subscribe</button>
</form>
<p id="{{ $id }}-status" role="status" class="subscribe-status"></p>
<script>
(function () {
var form = document.getElementById("{{ $id }}");
var status = document.getElementById("{{ $id }}-status");
form.addEventListener("submit", function (e) {
e.preventDefault();
if (form.website.value) return; // honeypot
var payload = {
email: form.email.value
};
var submitBtn = form.querySelector("button[type=submit]");
submitBtn.disabled = true;
status.textContent = "Subscribing…";
fetch("{{ .Site.Params.eec_base_url }}/subscribe", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(payload)
}).then(function (res) {
submitBtn.disabled = false;
if (res.ok) {
form.reset();
status.textContent = "You're on the list — check your inbox to confirm.";
return;
}
return res.text().then(function (msg) {
status.textContent = msg || "Something went wrong. Try again in a moment.";
});
}).catch(function () {
submitBtn.disabled = false;
status.textContent = "Something went wrong. Try again in a moment.";
});
});
})();
</script>