feat: remove newsletter subscription feature
All checks were successful
deploy / build-and-deploy (push) Successful in 55s
All checks were successful
deploy / build-and-deploy (push) Successful in 55s
This commit is contained in:
@@ -24,10 +24,6 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
env:
|
env:
|
||||||
SITE_URL: ${{ secrets.SITE_URL }}
|
SITE_URL: ${{ secrets.SITE_URL }}
|
||||||
PUBLIC_NEWSLETTER_ACTION: ${{ secrets.PUBLIC_NEWSLETTER_ACTION }}
|
|
||||||
PUBLIC_NEWSLETTER_EMAIL_FIELD: ${{ secrets.PUBLIC_NEWSLETTER_EMAIL_FIELD }}
|
|
||||||
PUBLIC_NEWSLETTER_TITLE: ${{ secrets.PUBLIC_NEWSLETTER_TITLE }}
|
|
||||||
PUBLIC_NEWSLETTER_DESCRIPTION: ${{ secrets.PUBLIC_NEWSLETTER_DESCRIPTION }}
|
|
||||||
run: npm run build
|
run: npm run build
|
||||||
|
|
||||||
- name: Write deploy key
|
- name: Write deploy key
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import HeaderLink from './HeaderLink.astro';
|
|||||||
<HeaderLink href="/">Home</HeaderLink>
|
<HeaderLink href="/">Home</HeaderLink>
|
||||||
<HeaderLink href="/blog">Blog</HeaderLink>
|
<HeaderLink href="/blog">Blog</HeaderLink>
|
||||||
<HeaderLink href="/search">Search</HeaderLink>
|
<HeaderLink href="/search">Search</HeaderLink>
|
||||||
<HeaderLink href="/subscribe">Subscribe</HeaderLink>
|
|
||||||
<HeaderLink href="/about">About</HeaderLink>
|
<HeaderLink href="/about">About</HeaderLink>
|
||||||
</div>
|
</div>
|
||||||
<div class="social-links">
|
<div class="social-links">
|
||||||
|
|||||||
@@ -1,74 +0,0 @@
|
|||||||
---
|
|
||||||
const action = import.meta.env.PUBLIC_NEWSLETTER_ACTION as string | undefined;
|
|
||||||
const emailField = (import.meta.env.PUBLIC_NEWSLETTER_EMAIL_FIELD as string | undefined) ?? 'email';
|
|
||||||
const title = (import.meta.env.PUBLIC_NEWSLETTER_TITLE as string | undefined) ?? 'Subscribe';
|
|
||||||
const description = (import.meta.env.PUBLIC_NEWSLETTER_DESCRIPTION as string | undefined) ?? 'Get new posts in your inbox.';
|
|
||||||
|
|
||||||
const ready = Boolean(action);
|
|
||||||
---
|
|
||||||
|
|
||||||
<section class="newsletter">
|
|
||||||
<h1>{title}</h1>
|
|
||||||
<p>{description}</p>
|
|
||||||
|
|
||||||
{!ready ? (
|
|
||||||
<p class="note">
|
|
||||||
Newsletter is not configured yet. Set <code>PUBLIC_NEWSLETTER_ACTION</code>.
|
|
||||||
</p>
|
|
||||||
) : (
|
|
||||||
<form class="form" method="post" action={action} target="_blank">
|
|
||||||
<label class="label">
|
|
||||||
<span class="sr-only">Email</span>
|
|
||||||
<input class="input" type="email" name={emailField} required autocomplete="email" placeholder="you@example.com" />
|
|
||||||
</label>
|
|
||||||
<button class="button" type="submit">Subscribe</button>
|
|
||||||
</form>
|
|
||||||
)}
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
.newsletter {
|
|
||||||
max-width: 42rem;
|
|
||||||
margin: 0 auto;
|
|
||||||
padding: 2rem 1.25rem;
|
|
||||||
}
|
|
||||||
.form {
|
|
||||||
display: flex;
|
|
||||||
gap: 0.75rem;
|
|
||||||
align-items: center;
|
|
||||||
margin-top: 1rem;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
.label {
|
|
||||||
flex: 1 1 18rem;
|
|
||||||
}
|
|
||||||
.input {
|
|
||||||
width: 100%;
|
|
||||||
padding: 0.75rem 0.9rem;
|
|
||||||
border: 1px solid rgba(0, 0, 0, 0.15);
|
|
||||||
border-radius: 0.6rem;
|
|
||||||
font: inherit;
|
|
||||||
}
|
|
||||||
.button {
|
|
||||||
padding: 0.75rem 1rem;
|
|
||||||
border: 1px solid rgba(0, 0, 0, 0.15);
|
|
||||||
border-radius: 0.6rem;
|
|
||||||
background: rgba(0, 0, 0, 0.04);
|
|
||||||
font: inherit;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
.note {
|
|
||||||
margin-top: 1rem;
|
|
||||||
opacity: 0.8;
|
|
||||||
}
|
|
||||||
.sr-only {
|
|
||||||
position: absolute;
|
|
||||||
width: 1px;
|
|
||||||
height: 1px;
|
|
||||||
padding: 0;
|
|
||||||
margin: -1px;
|
|
||||||
overflow: hidden;
|
|
||||||
clip: rect(0, 0, 0, 0);
|
|
||||||
border: 0;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
---
|
|
||||||
import SiteLayout from '../layouts/SiteLayout.astro';
|
|
||||||
import SubscribeForm from '../components/SubscribeForm.astro';
|
|
||||||
---
|
|
||||||
|
|
||||||
<SiteLayout title="Subscribe">
|
|
||||||
<SubscribeForm />
|
|
||||||
</SiteLayout>
|
|
||||||
Reference in New Issue
Block a user