diff --git a/src/app.d.ts b/src/app.d.ts index 98a2aa9..f9281b5 100644 --- a/src/app.d.ts +++ b/src/app.d.ts @@ -23,7 +23,6 @@ declare global { title: string; thumbnail?: string; date?: string; - dateChanged?: string; description: string; publisher: string; published?: boolean; diff --git a/src/blogs/test_unpublished.md b/src/blogs/test_unpublished.md index a70c772..c932b19 100644 --- a/src/blogs/test_unpublished.md +++ b/src/blogs/test_unpublished.md @@ -1,13 +1,9 @@ --- title: 'Тестовый блог' date: -dateChanged: '2025-09-29' description: 'Немного о самом сайте' -projects: ['ts-hldm'] --- # ПРИВЕТ ! -Добро пожаловать на наш первый блог-пост! - - +Добро пожаловать на наш первый блог-пост! \ No newline at end of file diff --git a/src/lib/components/Img.svelte b/src/lib/components/Img.svelte deleted file mode 100644 index fd7de17..0000000 --- a/src/lib/components/Img.svelte +++ /dev/null @@ -1,20 +0,0 @@ - - -
- {alt - {#if caption} -

{caption}

- {/if} -
diff --git a/src/lib/components/InfoBlock.svelte b/src/lib/components/InfoBlock.svelte deleted file mode 100644 index b93a76b..0000000 --- a/src/lib/components/InfoBlock.svelte +++ /dev/null @@ -1,13 +0,0 @@ - - -
-
- - Обратите внимание -
-
- -
-
diff --git a/src/lib/util/Blogs.ts b/src/lib/util/Blogs.ts index ad2d430..2e00ced 100644 --- a/src/lib/util/Blogs.ts +++ b/src/lib/util/Blogs.ts @@ -1,7 +1,5 @@ import path from 'path'; -export const THUMBNAIL_DEFAULT = "https://teasanctuary.ru/common/background-day.webp"; - export async function fetchPostsSorted() { const allPosts = await fetchPosts(); @@ -10,7 +8,7 @@ export async function fetchPostsSorted() { .filter((a) => !!a.date) .sort((a, b) => { return new Date(b.date!).valueOf() - new Date(a.date!).valueOf(); - }); + }); return sortedPosts; }; @@ -33,11 +31,3 @@ export async function fetchPosts() { return allPosts; }; - -export function resolveBlogPath(slug?: string, src?: string) { - if (!src) return null; - - return src.startsWith('http://') || src.startsWith('https://') - ? src - : `/blog/${slug}/${src}`; -} \ No newline at end of file diff --git a/src/routes/blog/+page.server.ts b/src/routes/blog/+page.server.ts deleted file mode 100644 index c5653b5..0000000 --- a/src/routes/blog/+page.server.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { fetchPostsSorted } from "$src/lib/util/Blogs"; - -export async function load() { - return { title: "Блог", description: "Новости и заметки проектов Tea Sanctuary", posts: await fetchPostsSorted() }; -} \ No newline at end of file diff --git a/src/routes/blog/+page.svelte b/src/routes/blog/+page.svelte index 8156cdd..befbbfd 100644 --- a/src/routes/blog/+page.svelte +++ b/src/routes/blog/+page.svelte @@ -1,25 +1,5 @@
@@ -34,63 +14,6 @@
- - Подпишитесь на нашу RSS ленту, чтобы не - пропускать новые посты! - - -
- {#each groupedPosts.entries() as [monthYear, postsInMonthYear]} -

- {monthYear} -

-
- {#each postsInMonthYear as post, i} - -
- {#if post.thumbnail} - thumbnail - {/if} -
-
-
-
- -

- {new Date(post.date!).toLocaleString('default', { - month: 'short', - day: 'numeric', - year: 'numeric' - })} -

-
-
- -

{post.title}

- - {#if post.description} -

{post.description}

- {/if} -
-
- {/each} -
- {/each} -
- diff --git a/src/routes/blog/[slug]/+page.svelte b/src/routes/blog/[slug]/+page.svelte deleted file mode 100644 index f9a3fc8..0000000 --- a/src/routes/blog/[slug]/+page.svelte +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - - -
-
-
-

{data.blogPost.title}

- {#if data.blogPost.description} -

{data.blogPost.description}

- {/if} -
-
-
-
-
- -

- {data.blogPost.date - ? new Date(data.blogPost.date).toLocaleString(undefined, { - month: 'short', - day: 'numeric', - year: 'numeric' - }) - : 'Не опубликован!'} -

-
- {#if data.blogPost.dateChanged} -
- -

- {new Date(data.blogPost.dateChanged).toLocaleString(undefined, { - month: 'short', - day: 'numeric', - year: 'numeric' - })} -

-
- {/if} -
- -{#if page.data.blogPost.projects?.length > 0} - -

В данной заметке упоминаются наши проекты:

- -
-{/if} - -
- -
- - diff --git a/src/routes/blog/[slug]/+page.ts b/src/routes/blog/[slug]/+page.ts deleted file mode 100644 index 46b041c..0000000 --- a/src/routes/blog/[slug]/+page.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { resolveBlogPath, THUMBNAIL_DEFAULT } from "$src/lib/util/Blogs.js"; -import { error } from "@sveltejs/kit"; - -export async function load({ params }) { - let post: any - try { - post = await import(`$src/blogs/${params.slug}.md`); - } catch (ex) { - error(404); - } - const blogPost: App.BlogPost = post.metadata; - const thumbnail = resolveBlogPath(params.slug, blogPost.thumbnail ?? THUMBNAIL_DEFAULT); - - return { - title: `${blogPost.title} — Блог`, - description: blogPost.description, - thumbnail: thumbnail, - content: post.default, - blogPost: { - ...blogPost - } - }; -}; diff --git a/static/blog/test_unpublished/wasd_perelesoq_game_jam_2025.png b/static/blog/test_unpublished/wasd_perelesoq_game_jam_2025.png deleted file mode 100644 index dd59dc2..0000000 Binary files a/static/blog/test_unpublished/wasd_perelesoq_game_jam_2025.png and /dev/null differ diff --git a/static/blog/hello_world/wasd_perelesoq_game_jam_2025.png b/static/blogs/hello_world/wasd_perelesoq_game_jam_2025.png similarity index 100% rename from static/blog/hello_world/wasd_perelesoq_game_jam_2025.png rename to static/blogs/hello_world/wasd_perelesoq_game_jam_2025.png diff --git a/static/favicon.ico b/static/favicon.ico deleted file mode 100644 index 6d27e04..0000000 Binary files a/static/favicon.ico and /dev/null differ