diff --git a/src/blogs/hello_world.md b/src/blogs/hello_world.md deleted file mode 100644 index 0acb57f..0000000 --- a/src/blogs/hello_world.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: 'Наш первый блог' -thumbnail: 'wasd_perelesoq_game_jam_2025.png' -date: '2025-09-19' -description: 'Немного о самом сайте' ---- - -# ПРИВЕТ ! - -Добро пожаловать на наш первый блог-пост! \ No newline at end of file diff --git a/src/lib/util/Blogs.ts b/src/lib/util/Blogs.ts deleted file mode 100644 index 851992e..0000000 --- a/src/lib/util/Blogs.ts +++ /dev/null @@ -1,30 +0,0 @@ -import path from 'path'; - -export async function fetchPostsSorted() { - const allPosts = await fetchPosts(); - - const sortedPosts = allPosts.sort((a, b) => { - return new Date(b.date).valueOf() - new Date(a.date).valueOf(); - }); - - return sortedPosts; -}; - -export async function fetchPosts() { - const allPostFiles = import.meta.glob('/src/blogs/*.md'); - const iterablePostFiles = Object.entries(allPostFiles); - - const allPosts: App.BlogPost[] = await Promise.all( - iterablePostFiles.map(async ([filePath, resolver]) => { - const { metadata }: any = await resolver(); - const { name } = path.parse(filePath); - - return { - slug: name, - ...metadata - }; - }) - ); - - return allPosts; -}; diff --git a/src/lib/util/LinkResolver.ts b/src/lib/util/LinkResolver.ts index 2c1c796..1f9c97d 100644 --- a/src/lib/util/LinkResolver.ts +++ b/src/lib/util/LinkResolver.ts @@ -45,7 +45,7 @@ function getIconFromUrl(url: URL): string | undefined { const href = url.href; if (href.startsWith('mailto:')) return 'email'; - if (href.endsWith('/rss.xml') || href.endsWith('/atom.rss')) + if (href.endsWith('/rss.xml')) return 'rss'; const hostname = url.hostname; diff --git a/src/routes/blog/rss.xml/+server.ts b/src/routes/blog/rss.xml/+server.ts deleted file mode 100644 index 0ed51da..0000000 --- a/src/routes/blog/rss.xml/+server.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { fetchPostsSorted } from "$src/lib/util/Blogs"; - -function escapeXml(unsafe: string): string { - return unsafe - .replace(/&/g, "&") - .replace(//g, ">") - .replace(/"/g, """) - .replace(/'/g, "'"); -} - -export async function GET({ setHeaders }) { - setHeaders({ - 'Cache-Control': 'max-age=0, s-maxage=3600', - 'Content-Type': 'application/rss+xml', - }); - const posts = await fetchPostsSorted(); - return new Response(String(` - - -Блог Tea Sanctuary -https://teasanctuary.ru/blog -1800 -${posts.map((post) => ` -${escapeXml(post.title)} -${escapeXml(post.description)} -https://teasanctuary.ru/blog/${post.slug} -https://teasanctuary.ru/blog/${post.slug} -${(new Date(post.date)).toUTCString()} -`).join("\n")} - -`)) -} \ No newline at end of file diff --git a/static/blogs/hello_world/wasd_perelesoq_game_jam_2025.png b/static/blogs/hello_world/wasd_perelesoq_game_jam_2025.png deleted file mode 100644 index dd59dc2..0000000 Binary files a/static/blogs/hello_world/wasd_perelesoq_game_jam_2025.png and /dev/null differ