Добавил дату последнего обновления фида и включил пререндер

This commit is contained in:
Иван Кузьменко 2025-09-29 02:28:51 +03:00
parent 2d010fdcce
commit 86dff5272e

View file

@ -1,5 +1,9 @@
import { fetchPostsSorted } from "$src/lib/util/Blogs";
export const prerender = true;
const feedUpdated = new Date();
function escapeXml(unsafe: string): string {
return unsafe
.replace(/&/g, "&")
@ -21,6 +25,7 @@ export async function GET({ setHeaders }) {
<title>Блог Tea Sanctuary</title>
<link>https://teasanctuary.ru/blog</link>
<ttl>1800</ttl>
<updated>${feedUpdated.toUTCString()}</updated>
${posts.map((post) => `<item>
<title>${escapeXml(post.title)}</title>
<description>${escapeXml(post.description)}</description>