@hutusi/amytis 1.13.0 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yml +1 -1
- package/.github/workflows/publish.yml +2 -2
- package/CHANGELOG.md +32 -0
- package/GEMINI.md +9 -1
- package/README.md +36 -2
- package/README.zh.md +36 -2
- package/TODO.md +10 -0
- package/bun.lock +123 -91
- package/content/flows/2026/03/05.md +1 -0
- package/content/flows/2026/03/07.md +2 -0
- package/content/series/modern-web-dev/index.mdx +4 -2
- package/content/series/rst-legacy/deeper-notes/images/test.svg +4 -0
- package/content/series/rst-legacy/deeper-notes/index.rst +15 -0
- package/content/series/rst-legacy/getting-started.rst +24 -0
- package/content/series/rst-legacy/index.rst +9 -0
- package/content/series/rst-readme/README.rst +9 -0
- package/content/series/rst-readme/readme-index-post.rst +10 -0
- package/content/series/rst-toctree/first-post.rst +6 -0
- package/content/series/rst-toctree/index.rst +10 -0
- package/content/series/rst-toctree/second-post.rst +6 -0
- package/content/series/rst-toctree-precedence/first-post.rst +6 -0
- package/content/series/rst-toctree-precedence/index.rst +12 -0
- package/content/series/rst-toctree-precedence/second-post.rst +6 -0
- package/docs/ARCHITECTURE.md +30 -4
- package/docs/CONTRIBUTING.md +11 -0
- package/docs/DIGITAL_GARDEN.md +22 -1
- package/eslint.config.mjs +2 -0
- package/next.config.ts +2 -2
- package/package.json +27 -21
- package/packages/create-amytis/package.json +1 -1
- package/packages/create-amytis/src/index.test.ts +43 -1
- package/packages/create-amytis/src/index.ts +64 -8
- package/public/next-image-export-optimizer-hashes.json +14 -73
- package/scripts/build-pagefind.ts +172 -0
- package/scripts/copy-assets.ts +246 -56
- package/scripts/generate-knowledge-graph.ts +2 -1
- package/scripts/new-flow.ts +1 -0
- package/scripts/render-rst.py +719 -0
- package/scripts/run-with-rst-python.ts +42 -0
- package/src/app/[slug]/[postSlug]/page.tsx +20 -10
- package/src/app/[slug]/page/[page]/page.tsx +15 -0
- package/src/app/all.atom/route.ts +7 -0
- package/src/app/all.xml/route.ts +7 -0
- package/src/app/archive/page.tsx +7 -4
- package/src/app/feed.atom/route.ts +2 -57
- package/src/app/feed.xml/route.ts +2 -64
- package/src/app/flows/[year]/[month]/[day]/page.tsx +13 -0
- package/src/app/flows/feed.atom/route.ts +7 -0
- package/src/app/flows/feed.xml/route.ts +7 -0
- package/src/app/globals.css +165 -0
- package/src/app/page.tsx +1 -0
- package/src/app/posts/feed.atom/route.ts +9 -0
- package/src/app/posts/feed.xml/route.ts +9 -0
- package/src/app/series/[slug]/page/[page]/page.tsx +74 -6
- package/src/app/series/[slug]/page.tsx +11 -13
- package/src/app/series/page.tsx +3 -3
- package/src/components/AuthorCard.tsx +25 -16
- package/src/components/CoverImage.tsx +5 -2
- package/src/components/FlowCalendarSidebar.tsx +1 -1
- package/src/components/FlowContent.tsx +2 -1
- package/src/components/FlowTimelineEntry.tsx +7 -1
- package/src/components/Footer.tsx +1 -1
- package/src/components/MarkdownRenderer.test.tsx +22 -0
- package/src/components/MarkdownRenderer.tsx +22 -17
- package/src/components/Navbar.tsx +1 -1
- package/src/components/PostSidebar.tsx +1 -1
- package/src/components/RecentNotesSection.tsx +4 -0
- package/src/components/RstRenderer.test.tsx +93 -0
- package/src/components/RstRenderer.tsx +122 -0
- package/src/layouts/PostLayout.tsx +5 -1
- package/src/layouts/SimpleLayout.tsx +10 -3
- package/src/lib/feed-utils.ts +158 -18
- package/src/lib/image-utils.test.ts +19 -0
- package/src/lib/image-utils.ts +11 -0
- package/src/lib/markdown.test.ts +140 -2
- package/src/lib/markdown.ts +747 -214
- package/src/lib/rehype-image-metadata.ts +2 -2
- package/src/lib/rst-renderer.test.ts +355 -0
- package/src/lib/rst-renderer.ts +617 -0
- package/src/lib/rst.test.ts +140 -0
- package/src/lib/rst.ts +470 -0
- package/src/lib/series-redirects.ts +42 -0
- package/tests/e2e/navigation.test.ts +26 -0
- package/tests/integration/collections.test.ts +17 -2
- package/tests/integration/feed-utils.test.ts +65 -0
- package/tests/integration/flow-title.test.ts +53 -0
- package/tests/integration/reading-time-headings.test.ts +5 -9
- package/tests/integration/series-draft.test.ts +16 -2
- package/tests/integration/series.test.ts +93 -0
- package/tests/tooling/build-pagefind.test.ts +66 -0
- package/tests/unit/static-params.test.ts +140 -0
package/.github/workflows/ci.yml
CHANGED
|
@@ -19,7 +19,7 @@ jobs:
|
|
|
19
19
|
|
|
20
20
|
- uses: oven-sh/setup-bun@v1
|
|
21
21
|
with:
|
|
22
|
-
bun-version:
|
|
22
|
+
bun-version: 1.3.11
|
|
23
23
|
|
|
24
24
|
- run: bun install --frozen-lockfile
|
|
25
25
|
|
|
@@ -43,7 +43,7 @@ jobs:
|
|
|
43
43
|
|
|
44
44
|
- uses: oven-sh/setup-bun@v1
|
|
45
45
|
with:
|
|
46
|
-
bun-version:
|
|
46
|
+
bun-version: 1.3.11
|
|
47
47
|
|
|
48
48
|
- run: bun install --frozen-lockfile
|
|
49
49
|
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,38 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.15.0] - 2026-04-12
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **First-Class rST Support**: Added robust reStructuredText post and series support through the Python/docutils pipeline, including README-based series indexes and better handling of legacy rST metadata and content structure.
|
|
12
|
+
- **Legacy rST Link Resolution**: Added support for legacy `:doc:` references, including same-series and cross-series links, so migrated rST content can keep its internal navigation intact.
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
- **rST Rendering Fidelity**: Improved rST rendering parity with Markdown for links, tables, code blocks, images, and general article presentation, making legacy content feel native inside Amytis.
|
|
16
|
+
- **Series Ordering Accuracy**: Series listing pages now sort by the real newest post date in each series instead of assuming the first rendered post is the latest one.
|
|
17
|
+
- **Build Performance**: Significantly reduced rebuild cost by caching rendered rST output, preserving nested image optimizer caches, tightening asset sync behavior, reducing generated image width buckets, and skipping Pagefind work when exported HTML is unchanged.
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
- **Legacy rST Edge Cases**: Fixed broken rST image rendering, restored docutils-based runtime rendering, accepted legacy single-digit date formats, improved adjacency/order handling for manually ordered rST series, and kept rST excerpts explicit when metadata omits them.
|
|
21
|
+
- **Image Optimizer Compatibility**: Prevented broken optimized URLs for local `.avif` and `.webp` sources by bypassing `next-image-export-optimizer` for those files in shared image renderers.
|
|
22
|
+
- **Create Amytis on Windows**: Fixed `create-amytis` scaffolding on Windows for releases containing Unicode paths by switching the Windows extraction path to ZIP + PowerShell. The scaffold package was also released separately as `create-amytis@0.1.2`.
|
|
23
|
+
|
|
24
|
+
## [1.14.0] - 2026-04-05
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
- **Type-Specific Feeds**: Introduced dedicated RSS and Atom feed endpoints for `/posts/feed.xml`, `/flows/feed.xml`, and a global `/all.xml` firehose, allowing readers to subscribe to specific content streams.
|
|
28
|
+
- **Namespaced Collections**: Collection items now support `folder/slug` syntax (e.g., `posts/my-post`, `web-dev/intro`) for explicit resolution, preventing slug collisions across different content directories.
|
|
29
|
+
- **Enhanced Feed Metadata**: Added RFC 4287 compliant author fallbacks for Atom feeds and optimized feed generation with lazy HTML rendering.
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
- **Copy-Paste UX**: Wrapped article content in background-stable containers to prevent "striping" when pasting into rich-text editors and applied `select-none` to navigation and sidebars for cleaner content selection.
|
|
33
|
+
- **Archive Page Robustness**: Refactored the chronological archive layout to prioritize titles and gracefully truncate long author lists, preventing layout shifts on posts with many contributors.
|
|
34
|
+
- **Test Coverage**: Added comprehensive integration tests for namespaced resolution and E2E tests for the new feed architecture.
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
- **XML Template Literals**: Fixed a syntax issue with escaped backticks in the RSS/Atom generator that caused build-time errors.
|
|
38
|
+
- **Archive Mobile Layout**: Improved layout stability on mobile devices for archive timeline entries.
|
|
39
|
+
|
|
8
40
|
## [1.13.0] - 2026-03-25
|
|
9
41
|
|
|
10
42
|
### Added
|
package/GEMINI.md
CHANGED
|
@@ -40,15 +40,18 @@ bun test
|
|
|
40
40
|
- `flows/`: Stream-style daily notes or micro-blogging (`[year]/[month]/[day]`).
|
|
41
41
|
- `series/`: Series overview and individual series catalog pages with pagination support.
|
|
42
42
|
- `books/`: Books overview and individual book/chapter pages (`[slug]/[chapter]`).
|
|
43
|
+
- `notes/`: Evergreen notes index and individual note pages with backlinks.
|
|
43
44
|
- `archive/`: Timeline-based chronological archive grouped by year and month.
|
|
44
45
|
- `tags/`: Popularity-sorted tag cloud and filtered listings.
|
|
45
46
|
- `authors/`: Posts filtered by individual authors.
|
|
47
|
+
- `graph/`: Interactive knowledge graph visualization of all connected content.
|
|
46
48
|
- `subscribe/`: Subscription options (RSS, Newsletter, Social).
|
|
47
49
|
- `search.json/`: Static search index generator (supplementary).
|
|
48
50
|
- `src/lib/`: Core logic and utilities.
|
|
49
51
|
- `markdown.ts`: Advanced parsing for posts/series/flows, sorting, and metadata.
|
|
50
52
|
- `search-utils.ts`: Content cleaning and search result processing.
|
|
51
53
|
- `shuffle.ts`: Deterministic and random array shuffling.
|
|
54
|
+
- `urls.ts`: Centralized URL routing and link generation logic.
|
|
52
55
|
- `src/components/`: Modular UI blocks (Hero, HorizontalScroll, Search, CoverImage, ShareBar, etc.).
|
|
53
56
|
- `content/`: Source Markdown/MDX content.
|
|
54
57
|
- `scripts/`: CLI tools for content management and asset processing.
|
|
@@ -57,10 +60,12 @@ bun test
|
|
|
57
60
|
|
|
58
61
|
### Advanced Content Management
|
|
59
62
|
- **Posts**: Supports both flat files (`.mdx`) and nested folders (`/index.mdx`) with co-located assets.
|
|
60
|
-
- **Flows**: Daily notes or micro-posts organized by date (`YYYY/MM/DD`). Designed for quick thoughts and stream-of-consciousness updates.
|
|
63
|
+
- **Flows**: Daily notes or micro-posts organized by date (`YYYY/MM/DD`). Designed for quick thoughts and stream-of-consciousness updates. Supports optional titles via frontmatter or H1 headings.
|
|
61
64
|
- **Series**:
|
|
62
65
|
- Robust grouping with folder-based or file-based entries.
|
|
63
66
|
- Configurable sorting: `date-asc`, `date-desc`, or `manual` (explicit list of slugs).
|
|
67
|
+
- **Collections**: Specialized series (`type: collection`) that allow manual curation of posts and other series.
|
|
68
|
+
- **Namespaced Referencing**: Collection items support `folder/slug` syntax (e.g., `posts/my-post`, `web-dev/intro`) to explicitly resolve posts and prevent collisions across different content directories.
|
|
64
69
|
- Cross-referencing: Series can include posts from the general pool or other folders.
|
|
65
70
|
- Metadata inheritance: Posts can inherit attributes (like authors) from series index files.
|
|
66
71
|
- **Featured Content**: Mark posts or series as `featured` to display them in prominent homepage sections with horizontal scrolling.
|
|
@@ -95,3 +100,6 @@ bun test
|
|
|
95
100
|
- Added pagination to the main posts list and individual series pages.
|
|
96
101
|
- Implemented sophisticated reading time calculation for mixed Latin and CJK text.
|
|
97
102
|
- Enhanced author management with metadata inheritance and slug-based routing.
|
|
103
|
+
- Implemented **Namespaced Collections**: manually curated series now support `folder/slug` references to prevent post collisions and ensure explicit content resolution.
|
|
104
|
+
- Added **Type-Specific Feeds**: dedicated RSS/Atom endpoints for `/posts`, `/flows`, and a global `/all` firehose.
|
|
105
|
+
- Improved **Copy-Paste UX**: wrapped article content in background-stable containers and added `select-none` to UI navigation to ensure clean, high-fidelity content selection.
|
package/README.md
CHANGED
|
@@ -44,6 +44,8 @@ Further reading: [How to Get AI to Write Better Code](https://hutusi.com/weeklie
|
|
|
44
44
|
- **Full-text Search:** Fast, static client-side search across all content (Cmd/Ctrl+K) powered by Pagefind.
|
|
45
45
|
- **Structured Content:**
|
|
46
46
|
- **Series:** Multi-part content organization with manual or automatic ordering.
|
|
47
|
+
- **Legacy rST Series:** A series can opt into reStructuredText by using `index.rst` or `README.rst`; mixed Markdown and rST files in the same series fail the build.
|
|
48
|
+
- **Docutils-backed rST Rendering:** When `docutils` is available, rST series render through the Python/docutils path instead of the lightweight fallback parser.
|
|
47
49
|
- **Books:** Long-form content with explicit chapters, parts, and a dedicated reading interface.
|
|
48
50
|
- **Notes:** Atomic, evergreen concepts for personal knowledge management.
|
|
49
51
|
- **Flows:** Stream-style daily notes or micro-blogging for quick thoughts.
|
|
@@ -58,6 +60,7 @@ Further reading: [How to Get AI to Write Better Code](https://hutusi.com/weeklie
|
|
|
58
60
|
- Light/Dark mode with automatic system detection.
|
|
59
61
|
- Four color palettes: default (emerald), blue, rose, amber.
|
|
60
62
|
- Responsive layout optimized for reading.
|
|
63
|
+
- Clean Selection: UI elements are non-selectable to ensure high-fidelity copy-pasting of article content.
|
|
61
64
|
- Horizontal scrolling for featured content on the homepage.
|
|
62
65
|
- **Table of Contents:** Sticky TOC with scroll tracking, reading progress indicator, and active heading highlight.
|
|
63
66
|
- **Flexible Content Structure:**
|
|
@@ -70,7 +73,7 @@ Further reading: [How to Get AI to Write Better Code](https://hutusi.com/weeklie
|
|
|
70
73
|
- Fully static export with optimized WebP images.
|
|
71
74
|
- Open Graph and Twitter card metadata for every content type.
|
|
72
75
|
- JSON-LD structured data (`BlogPosting`, `Book`, `Article`) for Google rich results.
|
|
73
|
-
- RSS/Atom feed
|
|
76
|
+
- RSS/Atom feeds including a main curated feed (`feed.xml`), plus type-specific feeds (`/posts/feed.xml`, `/flows/feed.xml`, `/all.xml`). Configurable format (`rss` | `atom` | `both`) and content depth (`full` | `excerpt`).
|
|
74
77
|
- Feed auto-discovery links in `<head>`, native sitemap generation.
|
|
75
78
|
- Multilingual reading time estimate (supports Latin and CJK).
|
|
76
79
|
- **Integrations:**
|
|
@@ -212,6 +215,8 @@ Amytis is built around Next.js static export with `output: "export"` and `traili
|
|
|
212
215
|
- Posts default to `/<posts.basePath>/<slug>` and `posts.basePath` defaults to `/posts`.
|
|
213
216
|
- If `series.autoPaths` is enabled, series posts move to `/<series-slug>/<post-slug>`.
|
|
214
217
|
- If `series.customPaths` is configured, those custom prefixes override `autoPaths`.
|
|
218
|
+
- Frontmatter `redirectFrom` entries are exported as static redirect pages so legacy URLs can keep working.
|
|
219
|
+
- Prefer URL helpers over hardcoded post paths, because a canonical post URL may live under `/posts`, a series slug, or a custom prefix depending on config.
|
|
215
220
|
- Before moving series posts off the default posts path, run `bun run add-series-redirects --dry-run` and then `bun run add-series-redirects` so legacy URLs still resolve.
|
|
216
221
|
|
|
217
222
|
## Writing Content
|
|
@@ -231,14 +236,43 @@ Create daily notes in `content/flows/YYYY/MM/DD.md` or `.mdx`.
|
|
|
231
236
|
|
|
232
237
|
- CLI: `bun run new-flow` creates today’s entry
|
|
233
238
|
- Chat import: put exports in `imports/chats/` and run `bun run new-flow-from-chat`
|
|
239
|
+
- Optional Title: Set `title` in frontmatter or use an `# Heading` in the content to display a title alongside the date.
|
|
234
240
|
|
|
235
241
|
### Series
|
|
236
242
|
|
|
237
|
-
Create a directory in `content/series/<slug>/` with
|
|
243
|
+
Create a directory in `content/series/<slug>/` with either:
|
|
244
|
+
|
|
245
|
+
- `index.mdx` or `index.md` for a Markdown series
|
|
246
|
+
- `index.rst` or `README.rst` for an rST series
|
|
247
|
+
|
|
248
|
+
`README.mdx` and `README.md` are also accepted as Markdown series indexes. Then add posts as sibling files or folders using the same format as the series index. Mixed Markdown and rST files in one series are rejected at build time.
|
|
238
249
|
|
|
239
250
|
- CLI: `bun run new-series "Series Name"`
|
|
240
251
|
- You can also create a post directly inside an existing series with `bun run new "Post Title" --series <series-slug>`
|
|
241
252
|
|
|
253
|
+
#### rST / docutils workflow
|
|
254
|
+
|
|
255
|
+
For full-fidelity rST rendering, install `docutils` in a Python environment that the project can execute:
|
|
256
|
+
|
|
257
|
+
```bash
|
|
258
|
+
python3 -m pip install docutils pygments
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
If you want Amytis to use a specific interpreter, point `AMYTIS_RST_PYTHON` at it:
|
|
262
|
+
|
|
263
|
+
```bash
|
|
264
|
+
export AMYTIS_RST_PYTHON=/absolute/path/to/python
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
Current behavior:
|
|
268
|
+
|
|
269
|
+
- `index.rst` or `README.rst` makes the whole series rST-only.
|
|
270
|
+
- For rST series ordering, explicit `:posts:` metadata takes precedence. If `:posts:` is absent, Amytis uses simple local `.. toctree::` entry order from the series index. If neither exists, the series falls back to the existing date-based sort.
|
|
271
|
+
- rST assets such as `.. image::` and `.. figure::` are resolved relative to the source file and rewritten to the site asset paths.
|
|
272
|
+
- Supported legacy roles such as `:doc:`, `:ref:`, `:numref:`, `:math:`, and `:dtag:` are either rendered directly or degraded into readable inline output instead of docutils error blocks.
|
|
273
|
+
- Top-of-file docinfo metadata is parsed into Amytis metadata, but it is not rendered at the top of blog-style article HTML.
|
|
274
|
+
- If Python/docutils is unavailable, Amytis falls back to the lightweight built-in rST compatibility path. That path keeps series loading working, but it has lower fidelity than the docutils-backed renderer.
|
|
275
|
+
|
|
242
276
|
### Books
|
|
243
277
|
|
|
244
278
|
Books are long-form structured content under `content/books/<slug>/`.
|
package/README.zh.md
CHANGED
|
@@ -44,6 +44,8 @@ Amytis 围绕一条从碎片想法到精炼知识的路径来帮助个人或组
|
|
|
44
44
|
- **全文搜索:** 基于 Pagefind 的快速静态客户端全文搜索,支持 Cmd/Ctrl+K。
|
|
45
45
|
- **结构化内容体系:**
|
|
46
46
|
- **Series:** 支持手动或自动排序的多篇内容组织方式。
|
|
47
|
+
- **Legacy rST Series:** 当系列入口文件使用 `index.rst` 或 `README.rst` 时,该系列会按 reStructuredText 解析;同一系列中混用 Markdown 和 rST 会在构建时直接失败。
|
|
48
|
+
- **基于 docutils 的 rST 渲染:** 当环境中可用 `docutils` 时,rST 系列会走 Python/docutils 渲染路径,而不是轻量回退解析器。
|
|
47
49
|
- **Books:** 支持明确章节、分部以及专用阅读界面的长篇内容。
|
|
48
50
|
- **Notes:** 面向个人知识管理的原子化常青概念。
|
|
49
51
|
- **Flows:** 用于快速记录想法的流式日记或微博客。
|
|
@@ -58,6 +60,7 @@ Amytis 围绕一条从碎片想法到精炼知识的路径来帮助个人或组
|
|
|
58
60
|
- 明暗主题,自动跟随系统设置。
|
|
59
61
|
- 四套配色方案: default(emerald)、blue、rose、amber。
|
|
60
62
|
- 针对阅读优化的响应式布局。
|
|
63
|
+
- 纯净选区: UI 元素不可选中,确保文章内容的高保全复制。
|
|
61
64
|
- 首页精选内容支持横向滚动。
|
|
62
65
|
- **目录:** 吸顶目录支持滚动跟踪、阅读进度指示和当前标题高亮。
|
|
63
66
|
- **灵活的内容结构:**
|
|
@@ -70,7 +73,7 @@ Amytis 围绕一条从碎片想法到精炼知识的路径来帮助个人或组
|
|
|
70
73
|
- 全静态导出,并生成优化后的 WebP 图片。
|
|
71
74
|
- 为所有内容类型生成 Open Graph 和 Twitter Card 元数据。
|
|
72
75
|
- 提供 JSON-LD 结构化数据(`BlogPosting`、`Book`、`Article`),支持 Google 富媒体结果。
|
|
73
|
-
- RSS/Atom
|
|
76
|
+
- RSS/Atom 订阅源包含一个主 curated 订阅 (`feed.xml`),以及分类订阅(`/posts/feed.xml`, `/flows/feed.xml`, `/all.xml`)。支持可配置的格式(`rss` | `atom` | `both`)和内容深度(`full` | `excerpt`)。
|
|
74
77
|
- 在 `<head>` 中自动注入 Feed 自动发现链接,并原生生成 sitemap。
|
|
75
78
|
- 多语言阅读时长估算,支持 Latin 和 CJK。
|
|
76
79
|
- **集成能力:**
|
|
@@ -218,6 +221,8 @@ Amytis 基于 Next.js 静态导出构建,关键配置为 `output: "export"`
|
|
|
218
221
|
- 文章默认路径为 `/<posts.basePath>/<slug>`,其中 `posts.basePath` 默认值为 `/posts`。
|
|
219
222
|
- 启用 `series.autoPaths` 后,系列文章会移动到 `/<series-slug>/<post-slug>`。
|
|
220
223
|
- 如果配置了 `series.customPaths`,则会以这些自定义前缀覆盖 `autoPaths`。
|
|
224
|
+
- frontmatter 中的 `redirectFrom` 会在导出时生成静态跳转页,用于保留旧链接。
|
|
225
|
+
- 不要硬编码文章路径,优先使用 URL helper,因为规范 URL 可能位于 `/posts`、系列 slug 或自定义前缀之下。
|
|
221
226
|
- 在把系列文章从默认的 posts 路径迁走之前,先运行 `bun run add-series-redirects --dry-run`,再执行 `bun run add-series-redirects`,以确保旧链接仍然可访问。
|
|
222
227
|
|
|
223
228
|
## 内容写作
|
|
@@ -237,14 +242,43 @@ Amytis 基于 Next.js 静态导出构建,关键配置为 `output: "export"`
|
|
|
237
242
|
|
|
238
243
|
- CLI: `bun run new-flow` 会创建今天的记录
|
|
239
244
|
- 聊天导入: 将导出文件放入 `imports/chats/`,然后运行 `bun run new-flow-from-chat`
|
|
245
|
+
- 可选标题: 在 frontmatter 中设置 `title` 或在内容中使用 `# 标题`,即可在日期旁显示标题。
|
|
240
246
|
|
|
241
247
|
### Series
|
|
242
248
|
|
|
243
|
-
在 `content/series/<slug>/`
|
|
249
|
+
在 `content/series/<slug>/` 下创建目录,并选择以下其中一种入口文件:
|
|
250
|
+
|
|
251
|
+
- `index.mdx` 或 `index.md`,表示 Markdown 系列
|
|
252
|
+
- `index.rst` 或 `README.rst`,表示 rST 系列
|
|
253
|
+
|
|
254
|
+
`README.mdx` 和 `README.md` 也可作为 Markdown 系列入口。随后使用与入口文件一致的格式添加同级文章文件或子目录。同一系列中混用 Markdown 和 rST 会在构建时被拒绝。
|
|
244
255
|
|
|
245
256
|
- CLI: `bun run new-series "Series Name"`
|
|
246
257
|
- 也可以直接将文章创建到已有系列中: `bun run new "Post Title" --series <series-slug>`
|
|
247
258
|
|
|
259
|
+
#### rST / docutils 工作流
|
|
260
|
+
|
|
261
|
+
如果希望获得更完整的 rST 渲染效果,请在一个可执行的 Python 环境中安装 `docutils`:
|
|
262
|
+
|
|
263
|
+
```bash
|
|
264
|
+
python3 -m pip install docutils pygments
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
如果需要显式指定解释器,可设置 `AMYTIS_RST_PYTHON`:
|
|
268
|
+
|
|
269
|
+
```bash
|
|
270
|
+
export AMYTIS_RST_PYTHON=/absolute/path/to/python
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
当前行为:
|
|
274
|
+
|
|
275
|
+
- `index.rst` 或 `README.rst` 会让整个系列进入 rST 模式。
|
|
276
|
+
- 对于 rST 系列文章顺序,显式的 `:posts:` 元数据优先级最高;如果没有 `:posts:`,Amytis 会使用系列入口文件中简单本地 `.. toctree::` 条目的顺序;如果两者都没有,则回退到现有的基于日期排序。
|
|
277
|
+
- `.. image::`、`.. figure::` 等资源路径会相对源文件解析,并重写为站点可用的静态资源路径。
|
|
278
|
+
- `:doc:`、`:ref:`、`:numref:`、`:math:`、`:dtag:` 等常见 legacy role 会尽量直接渲染;无法完整支持时也会降级为可读的内联输出,而不是 docutils 报错块。
|
|
279
|
+
- 文件顶部的 docinfo 元数据会被解析为 Amytis 元数据,但不会再渲染为文章顶部的作者/版本信息块。
|
|
280
|
+
- 如果 Python/docutils 不可用,Amytis 会回退到内置的轻量 rST 兼容路径。这样仍可加载系列,但渲染保真度会低于 docutils 路径。
|
|
281
|
+
|
|
248
282
|
### Books
|
|
249
283
|
|
|
250
284
|
书籍是位于 `content/books/<slug>/` 下的长篇结构化内容。
|
package/TODO.md
CHANGED
|
@@ -22,6 +22,15 @@
|
|
|
22
22
|
- [ ] **Link Validator**: Script to check for broken internal wiki-links and external URLs.
|
|
23
23
|
- [ ] **Content Porter**: Tool to import/export notes from Obsidian or Notion.
|
|
24
24
|
- [ ] **Optimization**: Automatically compress and resize co-located images during build.
|
|
25
|
+
- [ ] **Build Performance**: Profile `build:dev`, clean stale export/search outputs before indexing, and consider a lighter local build path that skips expensive full-site indexing when not needed.
|
|
26
|
+
|
|
27
|
+
## 📚 rST Follow-up
|
|
28
|
+
- [ ] **Fixture Coverage**: Add more compatibility fixtures from legacy rST series, including nested lists, tables, directives, images, and internal links.
|
|
29
|
+
- [ ] **Parser Diagnostics**: Improve rST build errors with clearer file context, line numbers where possible, and actionable unsupported-syntax messages.
|
|
30
|
+
- [ ] **Syntax Contract**: Document the exact supported rST subset and explicitly list unsupported or partial constructs.
|
|
31
|
+
- [ ] **Asset & Link Handling**: Harden relative asset resolution and add validation for broken local rST links and image references.
|
|
32
|
+
- [ ] **Reading Time**: Reuse the shared mixed-CJK reading-time rules for rST content so Chinese, Japanese, and Korean text are counted consistently.
|
|
33
|
+
- [ ] **Advanced Constructs**: Evaluate the highest-value next rST features from real imported content, such as footnotes, simple tables, and selected directives.
|
|
25
34
|
|
|
26
35
|
## ✅ Completed Highlights
|
|
27
36
|
- [x] **JSON-LD Structured Data**: `BlogPosting`, `Book`, and `Article` schemas for Google rich results.
|
|
@@ -33,3 +42,4 @@
|
|
|
33
42
|
- [x] **Robust Engineering**: Zero hydration mismatches, Zod validation, and 64+ automated tests.
|
|
34
43
|
- [x] **Refined UI**: High-contrast typography, four color palettes, and horizontal scroll featured sections.
|
|
35
44
|
- [x] **Sub-features**: Newsletter/Subscribe page, Reading Progress, and Author Ecosystem.
|
|
45
|
+
- [x] **Series-scoped rST Support**: Strict rST series detection, README-based indexes, Unicode-safe static params, and legacy redirect handling.
|