This commit is contained in:
2026-01-18 22:25:19 +01:00
parent ba9bcbaa08
commit 76573dc378
2 changed files with 4 additions and 2 deletions

View File

@@ -9,6 +9,8 @@ type BlogEntry = {
createdAt: string, createdAt: string,
updatedAt: string, updatedAt: string,
tags?: string[], tags?: string[],
guid: string,
teaser: string,
}; };
type RPArticle = { type RPArticle = {

View File

@@ -35,7 +35,7 @@ async function getBlogEntries() {
title: '', title: '',
createdAt: '', createdAt: '',
updatedAt: '', updatedAt: '',
teaser: `${ dom.querySelector('article').textContent.slice(0, 128) }...`, teaser: `${ dom.querySelector('article')?.textContent.slice(0, 256).trimStart().trimEnd() }...`,
}; };
const metaTags = dom.querySelectorAll('meta') as unknown as NodeListOf<HTMLMetaElement>; const metaTags = dom.querySelectorAll('meta') as unknown as NodeListOf<HTMLMetaElement>;
for (const metaTag of metaTags) { for (const metaTag of metaTags) {
@@ -88,7 +88,7 @@ async function rss() {
<link>${ HOST }/blog/${ article.slug }</link> <link>${ HOST }/blog/${ article.slug }</link>
<pubDate>${ new Date(article.createdAt).toUTCString() }</pubDate> <pubDate>${ new Date(article.createdAt).toUTCString() }</pubDate>
<author>Daniel Ledda</author> <author>Daniel Ledda</author>
<description>${ article.content }</description> <description>${ article.teaser }</description>
<guid>${ article.guid }</guid> <guid>${ article.guid }</guid>
</item> </item>
`).join('')} `).join('')}