Files
reground-site/layouts/courses/single.html
T
will 4445da18bb
deploy / deploy (push) Successful in 4s
Add nav/footer, contact form, privacy/terms drafts, first course landing page
- baseof.html: proper header/nav/footer, CSS custom properties for
  light/dark, button and form component styles — no external theme
  dependency, avoiding the submodule/version churn from the earlier
  PaperMod attempt.
- Contact page: real form (honeypot spam protection) posting to the eec
  service's new /contact endpoint, replacing the plain mailto CTA.
- Privacy Policy and Terms drafts — grounded in what's actually true here
  (self-hosted mail/course infra, no third-party trackers), flagged as
  drafts pending review.
- courses/ section with a generic single template driven by front matter
  (eec_slug, pitch) and the first course, Find Your Right Readers —
  landing page only; the actual course content isn't authored in
  eec-courses yet, so enrolling will 404 until that's written.
- Fixed hugo.toml baseURL (was www.reground.org, but Caddy's canonical
  host is the bare domain — www redirects to it, not the other way).
2026-07-08 16:41:47 -04:00

47 lines
1.8 KiB
HTML

{{ define "main" }}
<h1 style="font-size:2rem; margin-bottom:0.5rem;">{{ .Title }}</h1>
{{ with .Params.pitch }}<div style="font-size:1.05rem; opacity:0.9;">{{ . | markdownify }}</div>{{ end }}
{{ .Content }}
<form id="enroll-form" style="margin-top:2rem; max-width:24rem;">
<label for="email">Email</label>
<input type="email" id="email" name="email" required autocomplete="email" placeholder="you@example.com">
<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 me day one</button>
<p id="enroll-status" role="status" style="margin-top:1rem;"></p>
</form>
<script>
(function () {
var form = document.getElementById("enroll-form");
var status = document.getElementById("enroll-status");
var slug = {{ .Params.eec_slug }};
form.addEventListener("submit", function (e) {
e.preventDefault();
if (form.website.value) return; // honeypot
var submitBtn = form.querySelector("button[type=submit]");
submitBtn.disabled = true;
status.textContent = "Signing you up…";
fetch("{{ .Site.Params.eec_base_url }}/courses/" + slug + "/enroll", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ email: form.email.value })
}).then(function (res) {
if (!res.ok) throw new Error("request failed");
form.reset();
form.hidden = true;
status.textContent = "Check your inbox — day one is on its way.";
}).catch(function () {
submitBtn.disabled = false;
status.textContent = "Something went wrong. Try again in a moment.";
});
});
})();
</script>
{{ end }}