feat: add serverless newsletter signup page

Adds newsletter.html with an email signup form that POSTs to a configured
serverless endpoint. The endpoint and API token live in
js/newsletter-config.js (token defaults to an empty deploy-time placeholder,
never hardcoded in page logic). Missing/invalid tokens and network failures
surface a fixed user-safe error; successful signups show a confirmation.
Links the page from the site navigation on all pages.
This commit is contained in:
bot-implementer
2026-08-25 19:15:56 +00:00
parent e24ba8916d
commit 24db5b8a50
7 changed files with 215 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Newsletter | My Personal Blog</title>
<link rel="stylesheet" href="css/style.css" />
</head>
<body>
<header class="site-header">
<nav class="site-nav" aria-label="Main navigation">
<a class="brand" href="index.html">My Blog</a>
<ul class="nav-links">
<li><a href="index.html">Home</a></li>
<li><a href="reading.html">Reading</a></li>
<li><a href="contact.html">Contact</a></li>
<li><a href="newsletter.html" aria-current="page">Newsletter</a></li>
</ul>
</nav>
</header>
<main>
<h1>Newsletter</h1>
<p>Occasional updates on new posts — no spam, unsubscribe anytime. Enter your email to subscribe.</p>
<form id="newsletter-form" class="newsletter-form">
<div class="form-field">
<label for="newsletter-email">Email</label>
<input type="email" id="newsletter-email" name="email" required autocomplete="email" placeholder="you@example.com" />
</div>
<button type="submit">Subscribe</button>
<p id="newsletter-status" class="newsletter-status" role="status" aria-live="polite"></p>
</form>
</main>
<footer class="site-footer">
<p>&copy; 2026 My Personal Blog</p>
</footer>
<script type="module" src="js/newsletter.js"></script>
</body>
</html>