update
This commit is contained in:
@@ -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 = {
|
||||||
|
|||||||
4
main.ts
4
main.ts
@@ -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('')}
|
||||||
|
|||||||
Reference in New Issue
Block a user