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 47 additions and 0 deletions

View file

@ -28,6 +28,13 @@ export default function({ comp }) {
style={iconStyle}
/>
</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>
<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>

View file

@ -2,8 +2,10 @@ import lume from "lume/mod.ts";
import jsx from "lume/plugins/jsx.ts";
import nav from "lume/plugins/nav.ts";
import sass from "lume/plugins/sass.ts";
import feed from "lume/plugins/feed.ts";
const site = lume({
location: new URL("https://www.fosterhangdaan.com/"),
server: {
port: 8080,
},
@ -16,5 +18,22 @@ site.copy("static", ".");
site.use(jsx());
site.use(nav());
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;

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
type: post
author:
name: Foster Hangdaan
email: foster@hangdaan.email

11
deno.lock generated
View file

@ -491,6 +491,7 @@
"https://deno.land/x/lume@v1.18.4/deps/path.ts": "83a4c2c85b7f6a4209ffc601271b2fd922e22a7adf9f8c6c4be70a36844d8836",
"https://deno.land/x/lume@v1.18.4/deps/react.ts": "f134f5c6e706d7771e79a7cdbaa3396ad2310ada239faa7b0a871695ab6b0aca",
"https://deno.land/x/lume@v1.18.4/deps/sass.ts": "f0faed2c8e75ed6c613e6643628bd5186d6c2cb29779ee9273e1686e87c67ad4",
"https://deno.land/x/lume@v1.18.4/deps/xml.ts": "0aeac39b8613c8d4e389277334c714937bb7c638ebd6ce1295d771dbedf44cbb",
"https://deno.land/x/lume@v1.18.4/deps/yaml.ts": "78504a539e041bc12898424bda5b474c813bbb05bef4bb41000790aa5f978c6c",
"https://deno.land/x/lume@v1.18.4/middlewares/logger.ts": "69e69099a2e3a8c62d0bb62014381337f6e855c6b330e210e4a705fe8111e10a",
"https://deno.land/x/lume@v1.18.4/middlewares/no_cache.ts": "95fb11d820d931b6aca268fa30aee22e315c556bd214e135bb9b5ddbcbe039d6",
@ -498,6 +499,7 @@
"https://deno.land/x/lume@v1.18.4/middlewares/reload.ts": "1162ee5fc3c7e1f6b5fb3da73a648fc71f0a64d30ca48f05ed066c8cb80adbb6",
"https://deno.land/x/lume@v1.18.4/middlewares/reload_client.js": "34d75e01503fae8180796de882af42b1125fac88f22a010a99d5548de1ba7d72",
"https://deno.land/x/lume@v1.18.4/mod.ts": "149acd75b0e3a25347930c547c64e1d122604111d92647962063e15fd3ee1fbe",
"https://deno.land/x/lume@v1.18.4/plugins/feed.ts": "2a782784abb4a50c65817f6283e167853291f6df8744916c5d22e799e9360cb4",
"https://deno.land/x/lume@v1.18.4/plugins/json.ts": "ca6bf1bc6d42639f7bdf581dc9318832d8c2eaf83ae3ecdab6f02dfc738896bf",
"https://deno.land/x/lume@v1.18.4/plugins/jsx.ts": "532a055f1c6c6f00d21d13cb658614d5f6fc56ea28266020d371ba5fb151461a",
"https://deno.land/x/lume@v1.18.4/plugins/markdown.ts": "31a27f73ed3c79c6c87808ef9e4343c0bbbf896220ee97e88dad4474f091fb39",
@ -509,7 +511,16 @@
"https://deno.land/x/lume@v1.18.4/plugins/search.ts": "af3ea229915f3580962c9da6be33ca8e639b8444ce8604769968afd731b9dd3c",
"https://deno.land/x/lume@v1.18.4/plugins/source_maps.ts": "d38cbbab19984133789628d9e575a8c3d604d8c40ac6976298bec531dd15193b",
"https://deno.land/x/lume@v1.18.4/plugins/url.ts": "43d3d47896a7322a8dd34572dedb4baa6f73a382594a2ff7c34a3a064dcc6c9e",
"https://deno.land/x/lume@v1.18.4/plugins/utils.ts": "6435d164539d9e408e7e818b080cc1a96ff76ed3c376160577a7df751b57fa07",
"https://deno.land/x/lume@v1.18.4/plugins/yaml.ts": "df24aac4098dba258f1ac331a3b16ba488a336eb63c51afed8f59201228d583c",
"https://deno.land/x/xml@2.1.1/mod.ts": "4a314a7a28d1ec92f899ce4c6991f0356c77550a75955ec3f4a36733f08548e8",
"https://deno.land/x/xml@2.1.1/parse.ts": "614b8648345ae93c641368836947484d321c7ac9312ae12ec750434353cd7385",
"https://deno.land/x/xml@2.1.1/stringify.ts": "930d35431f153b29d36549cff08fcfbe978e52ccb56af1e3baa2e0760f418b04",
"https://deno.land/x/xml@2.1.1/utils/parser.ts": "7f3b00aefabdd6d47e17061cbc35c3c4d44cc1ed174180b7eb70184e56bb5ba6",
"https://deno.land/x/xml@2.1.1/utils/stream.ts": "056e2f368d47932d77e431bbc4a8292359171cc9ce881ea31ce0aae30d763e68",
"https://deno.land/x/xml@2.1.1/utils/streamable.ts": "1603a5f10c859b95d4e9502365a0fba0b19d5d068356e20d5a6813cd37fee780",
"https://deno.land/x/xml@2.1.1/utils/stringifier.ts": "c701b506835237c0c6c0a08fd94e0a012b644def3f4c819c64788daf2e649ea3",
"https://deno.land/x/xml@2.1.1/utils/types.ts": "ecaf7785e54a6f1da6f8e56da2bce9853407ceb7d5b3b70f0a60a0890151fe4c",
"https://esm.sh/react@18.2.0/jsx-runtime": "914a55a07c388d345c5a0c11616ee5282242e8b8dfd0d505b83500ea04fd9870",
"https://esm.sh/stable/react@18.2.0/denonext/jsx-runtime.js": "54d8a51c6ca025380abd2d5302e4a9b38ff835d9759c4657e52314f587eaf6bf",
"https://esm.sh/stable/react@18.2.0/denonext/react.mjs": "3c4f23bcfc53b256fcfaf6f834fa9f584c3bb7be667b2682c6cb6ba8ef88f8e6"