Skip to content

Commit

Permalink
removed jotform from newsletter subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
luord committed Oct 19, 2024
1 parent e65e728 commit 18010ef
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 18 deletions.
4 changes: 2 additions & 2 deletions content/pages/contact.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ title: Contact
status: published
summary: Get in touch with me here!
order: 5
Template: contact
Template: custom/contact

You can reach out to me by:

* [Sending me an email (redirects to a mailto)]({static}/assets/redirect/email.html).
* Using any of the profiles linked below (that allow contacting people).
* Using any of the profiles linked below in "Find me" (that allow contacting people).
* Or sending a [Webmention](https://indieweb.org/Webmention) to this site:
6 changes: 6 additions & 0 deletions content/pages/newsletter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
title: Subscribe to the Newsletter
status: hidden
summary: Get notified about new posts and updates.
Template: custom/newsletter

Get notified about new posts and updates. You can unsubscribe at any time:
3 changes: 3 additions & 0 deletions publishconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
FEED_MAX_ITEMS = 10
CATEGORY_FEED_ATOM = 'feed/{slug}.atom.xml'

NEWSLETTER_URL = 'pages/newsletter'
NEWSLETTER_ENDPOINT = 'https://luord-newsletter.web.val.run'

# Following items are often useful when publishing

# SOCIAL SETTINGS
Expand Down
25 changes: 15 additions & 10 deletions theme/static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ body > footer, body > header {
text-align: center;
}

body > footer {
margin-top: 1em;
}

body > header li a {
border: 1px dotted;
padding: 1px 2px;
Expand Down Expand Up @@ -66,11 +70,11 @@ aside ul, #main ul, header ul, body > footer ul {
padding: 0;
}

body > footer li, body > header li, aside li a:before {
body > footer li, body > footer ul, body > header li, aside li a:before {
display: inline-block;
}

body > footer li + li, body > header li + li {
body > footer li, body > header li + li {
margin-left: 2ch;
}

Expand Down Expand Up @@ -107,6 +111,7 @@ aside li a:before {

body > footer li i {
font: normal 1.5em FontAwesome;
vertical-align: bottom;
}

body > footer img {
Expand All @@ -122,6 +127,14 @@ dt {
text-decoration: underline;
}

form {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 1ch;
padding: 0;
}

.cat-link:before {
content: "\f02c";
}
Expand Down Expand Up @@ -170,14 +183,6 @@ dt {
padding: 0;
}

.webmention {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 1ch;
padding: 0;
}

@media (prefers-color-scheme: light) {
html {
background-color: #f1f1f1;
Expand Down
1 change: 0 additions & 1 deletion theme/templates/article.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ <h1>
<ul class="navigator">
<li><a href="https://www.addtoany.com/share#url={{ SITEURL }}/{{ article.url }}">Share</a></li>
<li><a href="{{ SITEURL }}/{{ CONTACT_URL }}">Say hi!</a></li>
<li><a href="https://form.jotform.com/233346248810051">Subscribe to the newsletter</a></li>
</ul>

{% with target_url = SITEURL ~ '/' ~ article.url %}
Expand Down
9 changes: 6 additions & 3 deletions theme/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@
{% endfor %}
</ul>
</nav>
<p>
If you want to receive new blog posts directly to your email, <a href="https://form.jotform.com/233346248810051">subscribe here</a>.
</p>
</header>
<main>
{% block content_header %}<header><h1>Articles</h1></header>{% endblock %}
Expand All @@ -84,7 +81,13 @@
{% block sidebar %}{% endblock %}

<footer>
{% if (not page or 'newsletter' not in page.url) and NEWSLETTER_URL %}
<p>
If you want to receive new blog posts directly to your email, <a href="{{ SITEURL }}/{{ NEWSLETTER_URL }}">subscribe here</a>.
</p>
{% endif %}
<nav>
Find me on:
<ul>
<li><a rel="me" href="https://github.com/luord" aria-label="GitHub profile"><i aria-hidden="true" class="fab fa-github"></i></a></li>
<li><a rel="me" href="https://gitlab.com/luord" aria-label="GitLab profile"><i aria-hidden="true" class="fab fa-gitlab"></i></a></li>
Expand Down
File renamed without changes.
8 changes: 8 additions & 0 deletions theme/templates/custom/newsletter.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% extends "page.html" %}
{% block content %}
{{ super() }}
<form action="{{NEWSLETTER_ENDPOINT}}" method="post">
<input type="email" name="address" placeholder="Your email" required>
<input type="submit" value="Subscribe">
</form>
{% endblock %}
2 changes: 1 addition & 1 deletion theme/templates/fragments/webmention.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% if WEBMENTION_URL %}
<form class="webmention" action="{{WEBMENTION_URL}}" method="post">
<form action="{{WEBMENTION_URL}}" method="post">
<input type="hidden" name="target" value="{{ target_url }}">
<input type="url" name="source" placeholder="The URL with the mention" required>
<input type="submit" value="Send">
Expand Down
4 changes: 3 additions & 1 deletion theme/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,12 @@ <h2>Pages</h2>
<li><a class="feed-link" href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_RSS.format(slug=category.slug) }}">Feed</a></li>
{% elif FEED_ALL_ATOM %}
<li><a class="feed-link" href="{{ FEED_DOMAIN }}/{{ FEED_ALL_ATOM }}">Feed</a></li>
<li><a class="mail-link" href="https://form.jotform.com/233346248810051">Newsletter</a></li>
{% elif FEED_ALL_RSS %}
<li><a class="feed-link" href="{{ FEED_DOMAIN }}/{{ FEED_ALL_RSS }}">Feed</a></li>
{% endif %}
{% if NEWSLETTER_URL %}
<li><a class="mail-link" href="{{ SITEURL }}/{{ NEWSLETTER_URL }}">Newsletter</a></li>
{% endif %}
</ul>
<b>Browse content by</b>
<ul>
Expand Down

0 comments on commit 18010ef

Please sign in to comment.