summaryrefslogtreecommitdiff
path: root/src/http/tpl/follow.html
blob: 132706b0afdc0d10217765c5aaa19bcb8f6d3f28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
{{ define "body" }}

<script async type="module" src="{{ StaticURL "api.js" }}"></script>

<p>
  Here's your options for receiving updates about new posts:
</p>

<h2>Option 1: Email</h2>

<p>
  Email is by far my preferred option for notifying followers of new posts. The
  entire email list system for this site has been designed from scratch and is
  completely self-hosted in my living room.
</p>

<p>
  I solemnly swear that:
</p>

<ul>

  <li>
    You will never receive an email from me except to notify of a new post.
  </li>

  <li>
    Your email will never be provided or sold to anyone else for any reason.
  </li>

</ul>

<p>
  So smash that subscribe button!
</p>

<p>
  You will need to verify your email, so be sure to check your spam folder to
  complete the process if you don't immediately see anything in your inbox.
</p>

<p style="color: var(--nc-lk-2);">
  Unfortunately Google considers all emails from my mail server to be spam, so
  gmail emails are not allowed. Sorry (not sorry).
</p>

<style>

#emailStatus.success {
    color: green;
}

#emailStatus.fail {
    color: red;
}

</style>

<form action="javascript:void(0);">
  <input type="email" placeholder="name@host.com" id="emailAddress" />
  <input class="button-primary" type="submit" value="Subscribe" id="emailSubscribe" />
  <span id="emailStatus"></span>
</form>

<script>

const emailAddress = document.getElementById("emailAddress");
const emailSubscribe = document.getElementById("emailSubscribe");
const emailSubscribeOrigValue = emailSubscribe.value;
const emailStatus = document.getElementById("emailStatus");

emailSubscribe.onclick = async () => {

    const api = await import("{{ StaticURL "api.js" }}");

    emailSubscribe.disabled = true;
    emailSubscribe.className = "";
    emailSubscribe.value = "Please hold...";
    emailStatus.innerHTML = '';

    try {

        if (!window.isSecureContext) {
            throw "The browser environment is not secure.";
        }

        await api.call('/api/mailinglist/subscribe', {
            body: { email: emailAddress.value },
            requiresPow: true,
        });

        emailStatus.className = "success";
        emailStatus.innerHTML = "Verification email sent (check your spam folder)";

    } catch (e) {
        emailStatus.className = "fail";
        emailStatus.innerHTML = e;

    } finally {
        emailSubscribe.disabled = false;
        emailSubscribe.className = "button-primary";
        emailSubscribe.value = emailSubscribeOrigValue;
    }

};

</script>

<h2>Option 2: RSS</h2>

<p>
  RSS is the classic way to follow a site's updates, and we're bringing it back!
  Just give any RSS reader the following URL:
</p>

<p>
  <a href="{{ BlogHTTPURL "feed.xml" }}">{{ BlogHTTPURL "feed.xml" }}</a>
</p>

<p>
  There are literally thousands of RSS readers to choose from if you don't have
  one. Here's some recommendations:
</p>

<ul>
  <li>
    <a href="https://chrome.google.com/webstore/detail/rss-feed-reader/pnjaodmkngahhkoihejjehlcdlnohgmp">
      Google Chrome Browser Extension
    </a>
  </li>

  <li>
    <a href="https://f-droid.org/en/packages/net.etuldan.sparss.floss/">
      spaRSS
    </a>
    is my preferred android RSS reader, but you'll need to install
    <a href="https://f-droid.org/">f-droid</a> on your device to use it (a
    good thing to do anyway).
  </li>

  <li>
    <a href="https://ranchero.com/netnewswire/">NetNewsWire</a>
    is a good reader for iPhone/iPad/Mac devices, so I'm told. Their homepage
    description makes a much better sales pitch for RSS than I ever could.
  </li>
</ul>

{{ end }}

{{ template "base.html" . }}