From 78497d0757ea6a5bdbfb3927fdd567189f3d9863 Mon Sep 17 00:00:00 2001 From: minlong Date: Wed, 7 Oct 2026 13:02:32 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20=E5=A4=B4=E9=83=A8?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=85=A5=E5=8F=A3=E3=80=81=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E7=B2=BE=E9=80=89=E6=9B=B4=E6=96=B0=E4=B8=8E=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=20Chronicle=20=E7=BD=B2=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 站点头部新增搜索入口:中英文分别跳转到归档页 /blog/#article-search 与 /en/blog/#article-search - 首页「知识与思考的记录」精选更新:Tiptap 深度教程(四)、RSC 深入分析、JavaScript 完整学习路径,其余按最新日期兜底 - 移除页脚、i18n、README 与样式注释中的「设计参考 Chronicle」内容与入口 - 新增构建测试守护首页精选的中英文链接 Co-authored-by: CommandCodeBot --- README.en.md | 4 ++-- README.md | 4 ++-- src/components/HomePage.astro | 10 ++++++++-- src/i18n.ts | 2 -- src/layouts/BaseLayout.astro | 18 ++++++++---------- src/styles/global.css | 2 +- tests/build.test.mjs | 21 +++++++++++++++++++++ 7 files changed, 42 insertions(+), 19 deletions(-) diff --git a/README.en.md b/README.en.md index a03e7cca..69978ba8 100644 --- a/README.en.md +++ b/README.en.md @@ -1,8 +1,8 @@ # MyBlogDoc -[中文](README.md) · [Personal blog](https://yihuiblog.top/) · [Chronicle design reference](https://chronicle-83v.pages.dev/) +[中文](README.md) · [Personal blog](https://yihuiblog.top/) -A personal frontend knowledge base and blog, statically generated with Astro from the original Markdown articles. The interface follows Chronicle's editorial layout, with article lists, category filters, search, and reading pages. Chinese and English interface translations share the same article content; switching languages does not translate the articles. +A personal frontend knowledge base and blog, statically generated with Astro from the original Markdown articles. The interface uses an editorial layout, with article lists, category filters, search, and reading pages. Chinese and English interface translations share the same article content; switching languages does not translate the articles. ## Local development diff --git a/README.md b/README.md index 01e57c56..9fecc25d 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # MyBlogDoc -[English](README.en.md) · [个人博客](https://yihuiblog.top/) · [设计参考 Chronicle](https://chronicle-83v.pages.dev/) +[English](README.en.md) · [个人博客](https://yihuiblog.top/) -个人前端知识库与博客,使用 Astro 静态生成,继续以原来的 Markdown 文章为内容源。界面参照 Chronicle 的编辑部式排版,包含文章列表、分类筛选、搜索和文章阅读页;提供中文、英文界面,切换语言不会翻译文章正文。 +个人前端知识库与博客,使用 Astro 静态生成,继续以原来的 Markdown 文章为内容源。界面采用编辑部式排版,包含文章列表、分类筛选、搜索和文章阅读页;提供中文、英文界面,切换语言不会翻译文章正文。 ## 本地开发 diff --git a/src/components/HomePage.astro b/src/components/HomePage.astro index ccf7105c..0288407b 100644 --- a/src/components/HomePage.astro +++ b/src/components/HomePage.astro @@ -16,9 +16,15 @@ const base = normalizeBase(import.meta.env.BASE_URL); const href = (path = "") => localePath(path, locale, base); const posts = (await getPosts()).filter((post) => !post.empty); const subjects = [...new Set(posts.map((post) => post.id.split("/")[0]))]; +const picks = [ + "TipTap/Tiptap 深度教程(四):终极定制 - 从零创建你的专属扩展", + "翻译/「译」React 服务器组件 (RSCs) 的深入分析", + "学习路径/JavaScript完整指南", +]; +const highlights = picks.flatMap((id) => posts.filter((post) => post.id === id)); const featured = [ - ...posts.filter((post) => post.featured), - ...posts.filter((post) => !post.featured), + ...highlights, + ...posts.filter((post) => !highlights.includes(post)), ].slice(0, 3); const categories = new Map(); for (const post of posts) diff --git a/src/i18n.ts b/src/i18n.ts index d5a8c888..61e91f1e 100644 --- a/src/i18n.ts +++ b/src/i18n.ts @@ -130,7 +130,6 @@ const zh = { emailTitle: "邮件", openSource: "开源项目", feedback: "意见反馈", - designCredit: "设计参考 Chronicle", pageNotFound: "页面未找到", }; const en: typeof zh = { @@ -272,7 +271,6 @@ const en: typeof zh = { emailTitle: "Email", openSource: "Open source", feedback: "Feedback", - designCredit: "Design inspired by Chronicle", pageNotFound: "Page not found", }; export const ui = (locale: Locale = "zh") => (locale === "en" ? en : zh); diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index c926e828..ce657081 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -210,6 +210,13 @@ const nav = [ > {locale === "zh" ? "EN" : "中文"} + + +