Add RSS and JSON feeds

This commit is contained in:
Foster Hangdaan 2023-08-05 20:13:10 -04:00
parent 85b275f2f5
commit cf5c1c5496
Signed by: foster
GPG key ID: E48D7F49A852F112
5 changed files with 36 additions and 0 deletions

View file

@ -28,6 +28,13 @@ export default function({ comp }) {
style={iconStyle} style={iconStyle}
/> />
</a> </a>
<a href="https://www.fosterhangdaan.com/blog/feed.rss" title="RSS Feed">
<img
src="https://static.fosterhangdaan.com/icons/tabler-icons/latest/svg/rss.svg"
className="icon"
style={iconStyle}
/>
</a>
</div> </div>
<p>Copyright &copy; 2023 Foster Hangdaan</p> <p>Copyright &copy; 2023 Foster Hangdaan</p>
<p>Made with <a href="https://lume.land/" target="_blank">Lume</a>, <a href="https://www.typescriptlang.org/" target="_blank">TypeScript</a> and lots of <img src="https://static.fosterhangdaan.com/icons/tabler-icons/latest/svg/heart.svg" className="icon" style={{ filter: "var(--filter-red)" }} title="love"/>.</p> <p>Made with <a href="https://lume.land/" target="_blank">Lume</a>, <a href="https://www.typescriptlang.org/" target="_blank">TypeScript</a> and lots of <img src="https://static.fosterhangdaan.com/icons/tabler-icons/latest/svg/heart.svg" className="icon" style={{ filter: "var(--filter-red)" }} title="love"/>.</p>

View file

@ -2,8 +2,10 @@ import lume from "lume/mod.ts";
import jsx from "lume/plugins/jsx.ts"; import jsx from "lume/plugins/jsx.ts";
import nav from "lume/plugins/nav.ts"; import nav from "lume/plugins/nav.ts";
import sass from "lume/plugins/sass.ts"; import sass from "lume/plugins/sass.ts";
import feed from "lume/plugins/feed.ts";
const site = lume({ const site = lume({
location: new URL("https://www.fosterhangdaan.com/"),
server: { server: {
port: 8080, port: 8080,
}, },
@ -16,5 +18,22 @@ site.copy("static", ".");
site.use(jsx()); site.use(jsx());
site.use(nav()); site.use(nav());
site.use(sass()); site.use(sass());
site.use(feed({
query: "type=post",
output: [
"/blog/feed.rss",
"/blog/feed.json",
],
info: {
title: "Foster Hangdaan's Blog",
description: "My thoughts and ideas.",
date: new Date(),
language: "en",
},
items: {
title: "=title",
description: "=description",
}
}));
export default site; export default site;

9
blog/_data.yaml Normal file
View file

@ -0,0 +1,9 @@
links:
- rel: alternate
href: /blog/feed.rss
type: application/atom+xml
title: Foster Hangdaan's Blog
- rel: alternate
href: /blog/feed.json
type: application/json
title: Foster Hangdaan's Blog

View file

@ -1,4 +1,5 @@
layout: layouts/post.tsx layout: layouts/post.tsx
type: post
author: author:
name: Foster Hangdaan name: Foster Hangdaan
email: foster@hangdaan.email email: foster@hangdaan.email

BIN
deno.lock

Binary file not shown.