Add entry links

This commit is contained in:
Leandro Facchinetti 2020-03-23 17:28:18 -04:00
parent 8071d3a17e
commit 169637d408
1 changed files with 33 additions and 0 deletions

View File

@ -37,6 +37,31 @@ export const webServer = express()
); );
})().catch(next); })().catch(next);
}) })
.get("/entry", (req, res) =>
res.send(
renderHTML(
<Layout>
<p>
Typically each entry on a feed includes a link
<br />
to an online version of the same content,
<br />
but the content from the entries on a{" "}
<strong>Kill the Newsletter!</strong>
<br /> feed come from emailsan online version may not even exist
<br />
so youre reading this instead.
</p>
<p>
<a href="https://www.kill-the-newsletter.com">
<strong>Create an Inbox</strong>
</a>
</p>
</Layout>
)
)
)
.listen(8000); .listen(8000);
export const emailServer = new SMTPServer({ export const emailServer = new SMTPServer({
@ -206,6 +231,7 @@ function Feed({ name, identifier }: { name: string; identifier: string }) {
identifier identifier
)} ${feedURL(identifier)}`, )} ${feedURL(identifier)}`,
updated: now(), updated: now(),
author: { name: "Kill the Newsletter!" },
...Entry({ ...Entry({
title: `${name}” Inbox Created`, title: `${name}” Inbox Created`,
author: "Kill the Newsletter!", author: "Kill the Newsletter!",
@ -234,6 +260,13 @@ function Entry({
title, title,
author: { name: author }, author: { name: author },
updated: now(), updated: now(),
link: {
$: {
rel: "alternate",
type: "text/html",
href: "https://www.kill-the-newsletter.com/entry"
}
},
content: { content: {
...(html === false ? {} : { $: { type: "html" } }), ...(html === false ? {} : { $: { type: "html" } }),
_: content _: content