From 74cc476f904641522119fa0d0f6ec8febf5f2767 Mon Sep 17 00:00:00 2001 From: StepanovPlaton Date: Wed, 4 Feb 2026 16:25:30 +0400 Subject: [PATCH] Fixes --- public/admin/config.yml | 19 ++++++-- src/components/archivePanel.svelte | 6 ++- src/components/data/timelineItem.astro | 18 ++++++- src/components/navbar.astro | 5 +- src/constants/link-presets.ts | 2 +- src/content/posts/guide/cover.jpg | Bin 213364 -> 0 bytes src/content/posts/guide/index.md | 56 ---------------------- src/content/posts/у-меня-появился-сайт.md | 4 +- src/i18n/i18nKey.ts | 1 + src/i18n/languages/en.ts | 1 + src/i18n/languages/ja.ts | 1 + src/i18n/languages/ru.ts | 5 +- src/i18n/languages/zh.ts | 1 + src/pages/index.astro | 3 +- src/pages/skills.astro | 8 +++- src/pages/timeline.astro | 2 +- src/utils/projects.ts | 12 ++++- src/utils/timeline.ts | 3 +- twilight.config.yaml | 4 +- 19 files changed, 72 insertions(+), 79 deletions(-) delete mode 100644 src/content/posts/guide/cover.jpg delete mode 100644 src/content/posts/guide/index.md diff --git a/public/admin/config.yml b/public/admin/config.yml index d80723a..66a19c6 100644 --- a/public/admin/config.yml +++ b/public/admin/config.yml @@ -97,6 +97,7 @@ collections: - { label: "Type", name: "type", widget: "select", options: ["certificate","project","other"] } - { label: "Icon", name: "icon", widget: "string", required: false } - { label: "Color", name: "color", widget: "string", required: false } + - { label: "Not Pin", name: "not_pin", widget: "boolean", required: false, default: false, hint: "If enabled, this item will not be shown in the 'Current Status' section" } - name: "diary" label: "Diary" @@ -155,11 +156,19 @@ collections: - { label: "Site URL", name: "siteurl", widget: "string" } - { label: "Tags", name: "tags", widget: "list", required: false, default: [] } - - name: "worth-mentioning" - label: "Worth Mentioning" - file: "src/content/worth-mentioning.md" - fields: - - { label: "Body", name: "body", widget: "markdown" } + - name: "Static Pages" + label: "Static Pages" + files: + - label: "Worth Mentioning" + name: "worth-mentioning" + file: "src/content/worth-mentioning.md" + fields: + - { label: "Body", name: "body", widget: "markdown" } + - label: "About" + name: "about" + file: "src/content/about.md" + fields: + - { label: "Body", name: "body", widget: "markdown" } editor: diff --git a/src/components/archivePanel.svelte b/src/components/archivePanel.svelte index 3defa31..5a16ee7 100644 --- a/src/components/archivePanel.svelte +++ b/src/components/archivePanel.svelte @@ -69,7 +69,11 @@ let groups = $derived.by(() => { if (categories.length > 0) { filteredPosts = filteredPosts.filter( - (post) => post.data.category && categories.includes(post.data.category), + (post) => { + if (!post.data.category) return false; + const postCategory = post.data.category.trim(); + return categories.some(cat => cat.trim() === postCategory); + }, ); } diff --git a/src/components/data/timelineItem.astro b/src/components/data/timelineItem.astro index 056364f..098cc93 100644 --- a/src/components/data/timelineItem.astro +++ b/src/components/data/timelineItem.astro @@ -2,6 +2,7 @@ import { i18n } from "@i18n/translation"; import I18nKey from "@i18n/i18nKey"; import Icon from "@components/common/icon.astro"; +import { getResolvedSiteLang } from "@utils/language"; export interface Props { @@ -100,10 +101,23 @@ const getLinkIcon = (type: string) => { } }; +// 获取 локаль для форматирования дат +const getDateLocale = () => { + const lang = getResolvedSiteLang(); + const localeMap: Record = { + ru: "ru-RU", + en: "en-US", + zh: "zh-CN", + ja: "ja-JP", + }; + return localeMap[lang] || "en-US"; +}; + // 格式化日期 const formatDate = (dateString: string) => { const date = new Date(dateString); - return date.toLocaleDateString("zh-CN", { year: "numeric", month: "long" }); + const locale = getDateLocale(); + return date.toLocaleDateString(locale, { year: "numeric", month: "long" }); }; // 计算持续时间 @@ -330,7 +344,7 @@ const itemColor = item.color || "#3B82F6"; ))} {item.achievements.length > 3 && (
  • - ... 还有 {item.achievements.length - 3} 项成就 + {i18n(I18nKey.timelineMoreAchievements).replace("{0}", String(item.achievements.length - 3))}
  • )} diff --git a/src/components/navbar.astro b/src/components/navbar.astro index 13f1b9c..14ad9af 100644 --- a/src/components/navbar.astro +++ b/src/components/navbar.astro @@ -40,8 +40,9 @@ let links: NavbarLink[] = navbarConfig.links.map( "overflow-visible! max-w-(--page-width) h-18 mx-auto flex items-center justify-between md:px-4"]}>
    - - {siteConfig.title} + + {/*siteConfig.title*/} + Главная