Add nav/footer, contact form, privacy/terms drafts, first course landing page
deploy / deploy (push) Successful in 4s
deploy / deploy (push) Successful in 4s
- 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).
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
{{ define "main" }}
|
||||
<h1>Get in touch</h1>
|
||||
<p style="opacity:0.85;">Tell me a bit about what you're working on — I read every message myself.</p>
|
||||
|
||||
<form id="contact-form" style="margin-top:2rem;">
|
||||
<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>
|
||||
<p id="contact-status" role="status" style="margin-top:1rem;"></p>
|
||||
</form>
|
||||
|
||||
<script>
|
||||
(function () {
|
||||
var form = document.getElementById("contact-form");
|
||||
var status = document.getElementById("contact-status");
|
||||
form.addEventListener("submit", function (e) {
|
||||
e.preventDefault();
|
||||
var payload = {
|
||||
name: form.name.value,
|
||||
email: form.email.value,
|
||||
message: form.message.value,
|
||||
website: form.website.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) {
|
||||
if (!res.ok) throw new Error("request failed");
|
||||
form.reset();
|
||||
form.hidden = true;
|
||||
status.textContent = "Thanks — I'll get back to you soon.";
|
||||
}).catch(function () {
|
||||
submitBtn.disabled = false;
|
||||
status.textContent = "Something went wrong sending that. Try again, or email hello@reground.org directly.";
|
||||
});
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user