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/TipTap/\347\274\226\350\276\221\345\231\250\345\212\240\350\275\275\345\277\253\344\272\206 60%\357\274\232\346\210\221\344\273\254\346\230\257\346\200\216\344\271\210\346\212\212 1.5MB \347\232\204\"\350\265\230\350\202\211\"\345\210\207\346\216\211\347\232\204.md" "b/src/TipTap/\347\274\226\350\276\221\345\231\250\345\212\240\350\275\275\345\277\253\344\272\206 60%\357\274\232\346\210\221\344\273\254\346\230\257\346\200\216\344\271\210\346\212\212 1.5MB \347\232\204\"\350\265\230\350\202\211\"\345\210\207\346\216\211\347\232\204.md" index 8f41d044..54112560 100644 --- "a/src/TipTap/\347\274\226\350\276\221\345\231\250\345\212\240\350\275\275\345\277\253\344\272\206 60%\357\274\232\346\210\221\344\273\254\346\230\257\346\200\216\344\271\210\346\212\212 1.5MB \347\232\204\"\350\265\230\350\202\211\"\345\210\207\346\216\211\347\232\204.md" +++ "b/src/TipTap/\347\274\226\350\276\221\345\231\250\345\212\240\350\275\275\345\277\253\344\272\206 60%\357\274\232\346\210\221\344\273\254\346\230\257\346\200\216\344\271\210\346\212\212 1.5MB \347\232\204\"\350\265\230\350\202\211\"\345\210\207\346\216\211\347\232\204.md" @@ -1,19 +1,3 @@ -## 候选标题(5 个) - -**① 编辑器加载快了 60%:我们是怎么把 1.5MB 的"赘肉"切掉的** - -**② 代码级拆解:一个富文本编辑器的"核心瘦身 + 插件外挂"架构实战** - -**③ 告别"全家桶"式打包——从 B 站编辑器看前端重型模块的按需加载方案** - -**④ 你的编辑器为什么慢?一文讲透 Addon 架构的设计哲学与工程细节** - -**⑤ dynamic import + globalThis + preload:大厂编辑器的三板斧瘦身术** - ---- - -## 正文 - 一个富文本编辑器,功能越做越多:画板(Excalidraw,~800KB)、思维导图(MindMap,~200KB)、流程图(Mermaid,~500KB)、AI 助手(~150KB)……当这些功能全部打进一个 bundle,用户还没敲第一个字,浏览器就已经在下载 **1.5MB 以上的"死重"**——而绝大多数用户可能一辈子都不会点开画板。 这不是功能的问题,**是加载策略的问题**。 diff --git a/src/components/ArticlePage.astro b/src/components/ArticlePage.astro index eb4e6ef6..65354fbb 100644 --- a/src/components/ArticlePage.astro +++ b/src/components/ArticlePage.astro @@ -37,7 +37,7 @@ const editUrl = `https://github.com/MoMeak9/MyBlogDoc/edit/main/src/${post.id.sp post={post} >
-
+
diff --git a/src/styles/global.css b/src/styles/global.css index 98ed5265..8657c0fb 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -1,4 +1,4 @@ -/* Chronicle's editorial proportions and two color palettes. */ +/* Editorial proportions and two color palettes. */ .sr-only { position: absolute; width: 1px; diff --git "a/src/\345\211\215\347\253\257\346\235\202\346\226\207/Google \346\240\270\345\277\203 Web \346\214\207\346\240\207.md" "b/src/\345\211\215\347\253\257\346\235\202\346\226\207/Google \346\240\270\345\277\203 Web \346\214\207\346\240\207.md" index c762ffbf..18c4ff09 100644 --- "a/src/\345\211\215\347\253\257\346\235\202\346\226\207/Google \346\240\270\345\277\203 Web \346\214\207\346\240\207.md" +++ "b/src/\345\211\215\347\253\257\346\235\202\346\226\207/Google \346\240\270\345\277\203 Web \346\214\207\346\240\207.md" @@ -69,7 +69,6 @@ FID 测量从用户第一次与页面交互(例如当他们单击链接、点 ### Performance API 这个是HTML5新增的API。早期看见有些开发者在页面加载时,在``里面添加上一段获取时间戳的代码,然后在开始获取数据的时候在获取一次时间戳,相减来计算白屏时间。这其实是一种非常麻烦的做法,并不友好。因此W3C后面推出了Performance这个API来帮助开发者查看这些性能时间点。 -更多内容可以看我的另一篇文章,待更新...... > **参考:** > diff --git "a/src/\345\244\226\346\226\207\347\277\273\350\257\221/Islands Architecture \345\255\244\345\262\233\346\236\266\346\236\204.md" "b/src/\345\244\226\346\226\207\347\277\273\350\257\221/Islands Architecture \345\255\244\345\262\233\346\236\266\346\236\204.md" index aa9cc603..b7d02dad 100644 --- "a/src/\345\244\226\346\226\207\347\277\273\350\257\221/Islands Architecture \345\255\244\345\262\233\346\236\266\346\236\204.md" +++ "b/src/\345\244\226\346\226\207\347\277\273\350\257\221/Islands Architecture \345\255\244\345\262\233\346\236\266\346\236\204.md" @@ -1,8 +1,3 @@ -> category: -> - 前端 -> - JavaScript -> - 外文翻译 - # Islands Architecture 孤岛(岛屿)架构 > 原文:https://www.patterns.dev/vanilla/islands-architecture diff --git "a/src/\345\244\226\346\226\207\347\277\273\350\257\221/URL \350\256\276\350\256\241\346\234\200\344\275\263\345\256\236\350\267\265.md" "b/src/\345\244\226\346\226\207\347\277\273\350\257\221/URL \350\256\276\350\256\241\346\234\200\344\275\263\345\256\236\350\267\265.md" index eceacd4d..484bac13 100644 --- "a/src/\345\244\226\346\226\207\347\277\273\350\257\221/URL \350\256\276\350\256\241\346\234\200\344\275\263\345\256\236\350\267\265.md" +++ "b/src/\345\244\226\346\226\207\347\277\273\350\257\221/URL \350\256\276\350\256\241\346\234\200\344\275\263\345\256\236\350\267\265.md" @@ -1,8 +1,3 @@ -> category: -> - 前端 -> - JavaScript -> - 外文翻译 - > 原文:https://blog.jim-nielsen.com/2023/examples-of-great-urls/ > > 标题:Examples of Great URL Design diff --git "a/src/\346\227\245\346\234\254/\350\241\214\347\250\213.md" "b/src/\346\227\245\346\234\254/\350\241\214\347\250\213.md" index dcc82dfe..4dbe475a 100644 --- "a/src/\346\227\245\346\234\254/\350\241\214\347\250\213.md" +++ "b/src/\346\227\245\346\234\254/\350\241\214\347\250\213.md" @@ -1,5 +1,3 @@ -备选:五一假期,请2 - ## Day 1 东京 diff --git a/tests/build.test.mjs b/tests/build.test.mjs index 571519d6..31493f45 100644 --- a/tests/build.test.mjs +++ b/tests/build.test.mjs @@ -296,6 +296,27 @@ test("absolute local navigation and media URLs resolve to published files", (t) ); }); +test("home pages feature the curated highlight articles in both locales", () => { + const picks = [ + "TipTap/Tiptap 深度教程(四):终极定制 - 从零创建你的专属扩展", + "翻译/「译」React 服务器组件 (RSCs) 的深入分析", + "学习路径/JavaScript完整指南", + ]; + for (const locale of ["zh", "en"]) { + const html = artifact(join(locale === "en" ? "en" : "", "index.html")); + const links = [...html.matchAll(/]*>/gi)].map((match) => + attributes(match[0]), + ); + for (const id of picks) { + const href = localizedRoute(`posts/${encodeId(id)}`, locale); + assert.ok( + links.some((link) => link.href === href), + `${locale} home page must feature ${id}.`, + ); + } + } +}); + test("sitemaps include every public locale page and omit errors and legacy redirects", () => { const index = artifact("sitemap-index.xml"); assert.match(index, /