Mirrors twosquirrelspress-site's submissions form and michaelferrara-site's gift/course-enroll pattern. Gift page content, cover art, and the download file are stubs until the real reader-magnet is ready. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
<!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="{{ .Description | default .Site.Params.description }}">
|
||||
{{ with .Params.social_image | default .Params.cover_image }}
|
||||
<meta property="og:title" content="{{ $.Title }}">
|
||||
<meta property="og:description" content="{{ $.Description | default $.Site.Params.description }}">
|
||||
<meta property="og:image" content="{{ . }}">
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
{{ end }}
|
||||
{{ $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>
|
||||
|
||||
<header class="site-header">
|
||||
<a class="site-title" href="/">{{ .Site.Title }}</a>
|
||||
<nav aria-label="Primary">
|
||||
{{ range .Site.Menus.main }}
|
||||
<a href="{{ .URL }}">{{ .Name }}</a>
|
||||
{{ end }}
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<main id="main-content">
|
||||
{{ block "main" . }}{{ end }}
|
||||
</main>
|
||||
|
||||
<footer class="site-footer">
|
||||
<span>© {{ now.Year }} {{ .Site.Title }}</span>
|
||||
<nav aria-label="Footer">
|
||||
{{ range .Site.Menus.footer }}
|
||||
<a href="{{ .URL }}">{{ .Name }}</a>
|
||||
{{ end }}
|
||||
</nav>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,60 @@
|
||||
{{ 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>
|
||||
</form>
|
||||
<p id="contact-status" role="status" style="margin-top:1rem;"></p>
|
||||
|
||||
<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) {
|
||||
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 hello@thistleandmoth.org directly.";
|
||||
});
|
||||
}).catch(function () {
|
||||
submitBtn.disabled = false;
|
||||
status.textContent = "Something went wrong sending that. Try again, or email hello@thistleandmoth.org directly.";
|
||||
});
|
||||
});
|
||||
})();
|
||||
</script>
|
||||
{{ end }}
|
||||
@@ -0,0 +1,9 @@
|
||||
{{ define "main" }}
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{ .Content }}
|
||||
<ul>
|
||||
{{ range .Pages }}
|
||||
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
@@ -0,0 +1,4 @@
|
||||
{{ define "main" }}
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{ .Content }}
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user