mirror of
https://github.com/thiloho/thiloho.github.io.git
synced 2025-11-22 10:21:36 +01:00
Update RSS elements and TOC svg
This commit is contained in:
@@ -6,12 +6,24 @@ const parser = new MarkdownIt();
|
||||
|
||||
export const GET = async (context) => {
|
||||
const blog = await getCollection("blog");
|
||||
|
||||
const latestModDate = blog.reduce((latest, article) => {
|
||||
const modDate = article.data.modDate || article.data.pubDate;
|
||||
return modDate > latest ? modDate : latest;
|
||||
}, new Date(0));
|
||||
|
||||
return rss({
|
||||
title: "Thilo Hohlt’s Blog",
|
||||
description: "Thilo Hohlt’s Blog",
|
||||
title: "Thilo Hohlt's Blog",
|
||||
description: "Thilo Hohlt's Blog",
|
||||
site: context.site,
|
||||
trailingSlash: false,
|
||||
stylesheet: "pretty-feed-v3.xsl",
|
||||
xmlns: {
|
||||
atom: "http://www.w3.org/2005/Atom",
|
||||
},
|
||||
customData: `
|
||||
<lastBuildDate>${latestModDate.toUTCString()}</lastBuildDate>
|
||||
<atom:link href="${context.site}rss.xml" rel="self" type="application/rss+xml" />
|
||||
`,
|
||||
items: blog.map((article) => ({
|
||||
link: `/blog/${article.id}/`,
|
||||
content: sanitizeHtml(parser.render(article.body), {
|
||||
|
||||
Reference in New Issue
Block a user