Добавил дату последнего обновления фида и включил пререндер
This commit is contained in:
parent
2d010fdcce
commit
86dff5272e
1 changed files with 5 additions and 0 deletions
|
|
@ -1,5 +1,9 @@
|
||||||
import { fetchPostsSorted } from "$src/lib/util/Blogs";
|
import { fetchPostsSorted } from "$src/lib/util/Blogs";
|
||||||
|
|
||||||
|
export const prerender = true;
|
||||||
|
|
||||||
|
const feedUpdated = new Date();
|
||||||
|
|
||||||
function escapeXml(unsafe: string): string {
|
function escapeXml(unsafe: string): string {
|
||||||
return unsafe
|
return unsafe
|
||||||
.replace(/&/g, "&")
|
.replace(/&/g, "&")
|
||||||
|
|
@ -21,6 +25,7 @@ export async function GET({ setHeaders }) {
|
||||||
<title>Блог Tea Sanctuary</title>
|
<title>Блог Tea Sanctuary</title>
|
||||||
<link>https://teasanctuary.ru/blog</link>
|
<link>https://teasanctuary.ru/blog</link>
|
||||||
<ttl>1800</ttl>
|
<ttl>1800</ttl>
|
||||||
|
<updated>${feedUpdated.toUTCString()}</updated>
|
||||||
${posts.map((post) => `<item>
|
${posts.map((post) => `<item>
|
||||||
<title>${escapeXml(post.title)}</title>
|
<title>${escapeXml(post.title)}</title>
|
||||||
<description>${escapeXml(post.description)}</description>
|
<description>${escapeXml(post.description)}</description>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue