@hutusi/amytis 1.8.0 → 1.10.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.
Files changed (114) hide show
  1. package/.entire/settings.json +4 -0
  2. package/.github/workflows/ci.yml +1 -1
  3. package/CHANGELOG.md +38 -0
  4. package/CLAUDE.md +24 -19
  5. package/README.md +64 -31
  6. package/README.zh.md +172 -0
  7. package/content/about.mdx +64 -10
  8. package/content/about.zh.mdx +66 -9
  9. package/content/books/sample-book/images/digital-garden.svg +25 -0
  10. package/content/books/sample-book/index.mdx +4 -4
  11. package/content/books/sample-book/introduction.mdx +2 -0
  12. package/content/posts/legacy-markdown.md +0 -2
  13. package/content/posts/markdown-features.mdx +1 -1
  14. package/content/posts/multilingual-test.mdx +0 -1
  15. package/content/posts/syntax-highlighting-showcase.mdx +1 -0
  16. package/content/posts/understanding-react-hooks.mdx +1 -0
  17. package/content/series/ai-nexus-weekly/index.mdx +1 -1
  18. package/content/series/digital-garden/01-philosophy.mdx +27 -12
  19. package/content/series/digital-garden/index.mdx +1 -1
  20. package/content/series/markdown-showcase/index.mdx +1 -1
  21. package/content/series/markdown-showcase/syntax-highlighting.mdx +2 -0
  22. package/content/series/nextjs-deep-dive/01-getting-started.mdx +2 -1
  23. package/content/series/nextjs-deep-dive/index.mdx +1 -1
  24. package/content/subscribe.mdx +27 -0
  25. package/docs/ARCHITECTURE.md +85 -105
  26. package/docs/CONTRIBUTING.md +25 -4
  27. package/docs/DIGITAL_GARDEN.md +15 -11
  28. package/docs/deployment.md +31 -13
  29. package/imports/README.md +45 -0
  30. package/package.json +7 -3
  31. package/public/images/antelope-canyon.jpg +0 -0
  32. package/public/images/avatar.jpg +0 -0
  33. package/public/images/cappadocia.jpg +0 -0
  34. package/public/images/flowers.jpg +0 -0
  35. package/public/images/galaxy.jpg +0 -0
  36. package/public/images/lake.jpg +0 -0
  37. package/public/images/mountains.jpg +0 -0
  38. package/public/images/vibrant-waves.avif +0 -0
  39. package/public/images/wechat-qr.jpg +0 -0
  40. package/scripts/deploy.ts +77 -0
  41. package/scripts/import-book.ts +176 -0
  42. package/scripts/new-flow-from-chat.ts +238 -0
  43. package/scripts/sync-book-chapters.ts +210 -0
  44. package/site.config.example.ts +257 -0
  45. package/site.config.ts +80 -19
  46. package/src/app/[slug]/[postSlug]/page.tsx +148 -0
  47. package/src/app/[slug]/page/[page]/page.tsx +202 -0
  48. package/src/app/[slug]/page.tsx +162 -7
  49. package/src/app/archive/page.tsx +2 -1
  50. package/src/app/authors/[author]/page.tsx +3 -1
  51. package/src/app/books/[slug]/[chapter]/page.tsx +10 -2
  52. package/src/app/books/[slug]/page.tsx +6 -5
  53. package/src/app/feed.xml/route.ts +2 -1
  54. package/src/app/flows/[year]/[month]/[day]/page.tsx +4 -1
  55. package/src/app/flows/[year]/[month]/page.tsx +3 -0
  56. package/src/app/flows/[year]/page.tsx +3 -0
  57. package/src/app/flows/page/[page]/page.tsx +2 -0
  58. package/src/app/flows/page.tsx +2 -0
  59. package/src/app/globals.css +6 -1
  60. package/src/app/graph/page.tsx +2 -0
  61. package/src/app/layout.tsx +16 -3
  62. package/src/app/notes/[slug]/page.tsx +4 -3
  63. package/src/app/notes/page/[page]/page.tsx +2 -0
  64. package/src/app/notes/page.tsx +2 -0
  65. package/src/app/page/[page]/page.tsx +1 -0
  66. package/src/app/page.tsx +75 -9
  67. package/src/app/posts/[slug]/page.tsx +3 -0
  68. package/src/app/posts/page/[page]/page.tsx +9 -4
  69. package/src/app/posts/page.tsx +5 -2
  70. package/src/app/search.json/route.ts +2 -2
  71. package/src/app/series/[slug]/page/[page]/page.tsx +1 -0
  72. package/src/app/series/[slug]/page.tsx +3 -3
  73. package/src/app/sitemap.ts +3 -2
  74. package/src/app/tags/[tag]/page.tsx +3 -3
  75. package/src/components/AuthorCard.tsx +46 -14
  76. package/src/components/BookMobileNav.tsx +11 -11
  77. package/src/components/BookSidebar.tsx +17 -25
  78. package/src/components/BrowserDetectionBanner.tsx +96 -0
  79. package/src/components/Comments.tsx +4 -3
  80. package/src/components/CoverImage.tsx +11 -3
  81. package/src/components/CuratedSeriesSection.tsx +7 -6
  82. package/src/components/FeaturedStoriesSection.tsx +120 -54
  83. package/src/components/Hero.tsx +44 -92
  84. package/src/components/LanguageProvider.tsx +21 -7
  85. package/src/components/LanguageSwitch.tsx +1 -1
  86. package/src/components/LatestWritingSection.tsx +12 -22
  87. package/src/components/MarkdownRenderer.tsx +12 -4
  88. package/src/components/Navbar.tsx +27 -17
  89. package/src/components/PostCard.tsx +2 -1
  90. package/src/components/PostList.tsx +12 -9
  91. package/src/components/PostNavigation.tsx +3 -2
  92. package/src/components/PostSidebar.tsx +2 -1
  93. package/src/components/RecentNotesSection.tsx +1 -1
  94. package/src/components/RelatedPosts.tsx +2 -1
  95. package/src/components/RssFeedWidget.tsx +36 -0
  96. package/src/components/Search.tsx +4 -4
  97. package/src/components/SelectedBooksSection.tsx +11 -15
  98. package/src/components/SeriesCatalog.tsx +2 -1
  99. package/src/components/SeriesList.tsx +4 -3
  100. package/src/components/SeriesSidebar.tsx +2 -1
  101. package/src/i18n/translations.ts +22 -16
  102. package/src/layouts/BookLayout.tsx +3 -3
  103. package/src/layouts/PostLayout.tsx +31 -20
  104. package/src/layouts/SimpleLayout.tsx +3 -3
  105. package/src/lib/i18n.ts +83 -6
  106. package/src/lib/image-utils.ts +12 -0
  107. package/src/lib/markdown.ts +54 -19
  108. package/src/lib/rehype-image-metadata.test.ts +118 -0
  109. package/src/lib/rehype-image-metadata.ts +11 -5
  110. package/src/lib/urls.ts +36 -0
  111. package/tests/unit/static-params.test.ts +262 -0
  112. package/content/series/digital-garden/01-philosophy/index.mdx +0 -23
  113. package/src/app/subscribe/page.tsx +0 -17
  114. package/src/components/SubscribePage.tsx +0 -298
@@ -0,0 +1,4 @@
1
+ {
2
+ "enabled": true,
3
+ "telemetry": false
4
+ }
@@ -27,7 +27,7 @@ jobs:
27
27
  run: bun run lint
28
28
 
29
29
  - name: Run Tests
30
- run: bun test
30
+ run: bun run test
31
31
 
32
32
  - name: Build
33
33
  run: bun run build:dev
package/CHANGELOG.md CHANGED
@@ -5,6 +5,44 @@ 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.10.0] - 2026-03-02
9
+
10
+ ### Added
11
+ - **Configurable URL Topology**: Added support for `posts.basePath` and `series.customPaths` so posts and series can be served under custom prefixes.
12
+ - **Single-Language Mode**: Added `i18n.enabled` to disable multilingual routing/UI when running a single-locale site.
13
+ - **Homepage Content Controls**: Added pinned-post support and optional post subtitles for improved featured and latest sections.
14
+ - **Author Profile Expansion**: Added configurable default authors plus optional author avatar/social images and header/card visibility toggles.
15
+ - **Publishing Controls**: Added `posts.excludeFromListing` to keep selected series posts out of the main `/posts` feed.
16
+ - **Deployment & Media**: Added one-command Linux/nginx deploy script and `images.cdnBaseUrl` support for serving images from a CDN.
17
+ - **Branding Controls**: Added configurable logo and favicon paths in `site.config.ts`.
18
+
19
+ ### Changed
20
+ - **Homepage Design System**: Refined homepage layout and card hierarchy across hero, featured content, latest writing, and series sections.
21
+ - **Subscribe Surface**: Moved `/subscribe` to content-driven authoring so users can fully edit subscription copy in Markdown/MDX.
22
+ - **Documentation**: Updated architecture, deployment, and configuration guides to reflect current routing and feature behavior.
23
+
24
+ ### Fixed
25
+ - **Static Export Stability**: Fixed `output: "export"` edge cases by returning placeholder params for empty/disabled dynamic routes.
26
+ - **Dynamic Routing Conflicts**: Resolved route naming and generation conflicts for custom prefixes and static params.
27
+ - **Navigation Consistency**: Fixed mismatch between navigation post URL and configured posts base path.
28
+ - **Book Route Safety**: Prevented invalid book chapter params by validating chapter existence before route generation.
29
+ - **Image Handling**: Fixed markdown image path resolution across content types and ensured CDN prefixing is applied consistently.
30
+ - **Rendering & Type Safety**: Fixed TypeScript handling for custom `rss-feed` element and addressed dev-time WebP 404 behavior.
31
+
32
+ ## [1.9.0] - 2026-02-28
33
+
34
+ ### Added
35
+ - **Book Importer**: Added `bun run import-book` to import GitBook/Markdown-style books into `content/books/` with chapter mapping support.
36
+ - **Flow Chat Import Improvements**: Extended `new-flow-from-chat` with improved formatting and optional timestamp output.
37
+
38
+ ### Changed
39
+ - **Import Reliability**: Hardened `import-book` chapter path and ID handling for mixed source structures.
40
+
41
+ ### Fixed
42
+ - **Author Slug Normalization**: Stabilized `getAuthorSlug` output for bracketed and edge-case names.
43
+ - **Image Path Handling**: Fixed import image-path normalization to correctly handle `../images/`, `./images/`, and `images/` patterns.
44
+ - **Test Consistency**: Aligned static-params mock slug behavior with production logic to avoid CI-only test leakage failures.
45
+
8
46
  ## [1.8.0] - 2026-02-24
9
47
 
10
48
  ### Added
package/CLAUDE.md CHANGED
@@ -25,24 +25,18 @@ bun run build # Full production build (copies assets, builds Next.j
25
25
  bun run build:dev # Development build (no image optimization, faster) — also regenerates Pagefind search index in public/pagefind/
26
26
  bun run clean # Remove .next, out, public/posts directories
27
27
 
28
+ # Deploy
29
+ bun run deploy # Deploy out/ to Linux/nginx server via rsync+sshpass (reads .env.local)
30
+
28
31
  # Content creation
29
- bun run new "Post Title" # Create new post (flat file)
30
- bun run new "Title" --folder # Create as folder with index.mdx
31
- bun run new "Title" --prefix weekly # Create with prefix (e.g., weekly-title)
32
- bun run new "Title" --template custom # Use custom template from templates/
33
- bun run new "Title" --md # Create as .md instead of .mdx
34
- bun run new "Title" --series my-series # Create post in content/series/my-series/
35
- bun run new-series "Series Name" # Create new series with cover image
36
- bun run new-from-pdf doc.pdf # Create post from PDF (converts pages to images)
37
- bun run new-from-pdf doc.pdf --title "My Document" # With custom title
38
- bun run new-from-pdf doc.pdf --scale 3.0 # Higher resolution (default: 2.0)
32
+ bun run new "Post Title" # Create new post
33
+ bun run new-series "Series Name" # Create new series
34
+ bun run new-from-pdf doc.pdf # Create post from PDF
39
35
  bun run new-from-images ./photos # Create post from image folder
40
- bun run new-from-images ./photos --title "My Gallery" # With custom title
41
- bun run new-from-images ./photos --sort date # Sort by date (default: name)
42
- bun run new-from-images ./photos --no-copy # Reference images instead of copying
43
- bun run new-flow # Create today's flow note (.md)
44
- bun run new-flow "My Title" # Create flow with custom title
45
- bun run new-flow --mdx # Use .mdx format instead
36
+ bun run new-flow # Create today's flow note
37
+ bun run new-flow-from-chat # Import all new files from imports/chats/
38
+ bun run sync-book # Sync chapters list for all books from disk
39
+ bun run sync-book <slug> # Sync chapters list for one book
46
40
  ```
47
41
 
48
42
  ## Architecture
@@ -58,6 +52,7 @@ bun run new-flow --mdx # Use .mdx format instead
58
52
 
59
53
  - `site.config.ts` - Site configuration (nav, social, pagination, themes, i18n, analytics, comments)
60
54
  - `src/lib/markdown.ts` - Data access layer with all content query functions
55
+ - `src/lib/urls.ts` - Central URL helpers (`getPostUrl`, `getPostsBasePath`, `getSeriesCustomPaths`, etc.) — always use these instead of hardcoding `/posts/[slug]`
61
56
  - `src/lib/search-utils.ts` - Pure search utilities (URL type detection, date extraction, title cleaning, markdown stripping) shared by `Search` and the search index route
62
57
  - `src/app/globals.css` - Theme CSS variables and color palettes
63
58
  - `src/components/MarkdownRenderer.tsx` - MDX rendering with all plugins
@@ -83,7 +78,9 @@ bun run new-flow --mdx # Use .mdx format instead
83
78
  - `/flows/[year]` - Flows filtered by year
84
79
  - `/flows/[year]/[month]` - Flows filtered by month
85
80
  - `/flows/[year]/[month]/[day]` - Single flow detail page
86
- - `/[slug]` - Static pages (about, etc.)
81
+ - `/[slug]` - Static pages (about, subscribe, etc.) and custom posts/series listing pages
82
+ - `/[prefix]/[slug]` - Posts at custom URL prefixes (e.g. `/articles/my-post`, `/weeklies/my-post`)
83
+ - `/[prefix]/page/[page]` - Paginated listing at custom URL prefixes
87
84
 
88
85
  ### Content Structure
89
86
 
@@ -105,6 +102,7 @@ Key configuration options:
105
102
  - `nav` - Navigation links with weights
106
103
  - `social` - GitHub, Twitter, email links for footer
107
104
  - `series.navbar` - Series slugs to show in navbar dropdown
105
+ - `series.customPaths` - Per-series custom URL prefix e.g. `{ 'weeklies': 'weeklies' }` → posts at `/weeklies/[slug]`
108
106
  - `pagination.posts`, `pagination.series` - Items per page
109
107
  - `themeColor` - 'default' | 'blue' | 'rose' | 'amber'
110
108
  - `hero` - Homepage hero title and subtitle
@@ -113,6 +111,12 @@ Key configuration options:
113
111
  - `featured.stories` - Scrollable stories: `scrollThreshold` (default: 1), `maxItems` (default: 5)
114
112
  - `analytics.provider` - 'umami' | 'plausible' | 'google' | null
115
113
  - `comments.provider` - 'giscus' | 'disqus' | null
114
+ - `posts.basePath` - Custom URL prefix for all posts (default: `'posts'`); e.g. `'articles'` → posts at `/articles/[slug]`
115
+ - `posts.authors.default` - Fallback authors when a post has none set in frontmatter
116
+ - `posts.authors.showInHeader` - Show author byline below post title (default: true)
117
+ - `posts.authors.showAuthorCard` - Show author card at end of post (default: true)
118
+ - `posts.excludeFromListing` - Series slugs whose posts are hidden from `/posts` listing pages
119
+ - `authors` - Per-author profiles: `bio`, `avatar` (image path), `social` (array of `{ image, description }`)
116
120
 
117
121
  ## Content Frontmatter
118
122
 
@@ -129,6 +133,7 @@ authors: ["Author Name"]
129
133
  series: "series-slug" # Link to a series
130
134
  draft: true # Hidden in production
131
135
  featured: true # Show in featured section
136
+ pinned: true # Always shown in featured section; never shuffled away (hero = most recent pinned)
132
137
  coverImage: "./images/cover.jpg" # Local or external URL
133
138
  latex: true # Enable KaTeX math
134
139
  toc: false # Hide table of contents
@@ -171,11 +176,11 @@ chapters:
171
176
  - part: "Part I: Getting Started" # Optional part grouping
172
177
  chapters:
173
178
  - title: "Chapter Title"
174
- file: "chapter-file" # Maps to chapter-file.mdx in same directory
179
+ id: "chapter-file" # Maps to chapter-file.mdx or chapter-file/index.mdx
175
180
  - part: "Part II: Advanced"
176
181
  chapters:
177
182
  - title: "Another Chapter"
178
- file: "another-chapter"
183
+ id: "another-chapter"
179
184
  ---
180
185
  ```
181
186
 
package/README.md CHANGED
@@ -1,11 +1,24 @@
1
1
  # Amytis
2
2
 
3
- **Amytis** is a high-performance, elegant digital garden built with Next.js 16, React 19, and Tailwind CSS v4. It is designed for cultivating thoughts, sharing knowledge, and growing ideas with a focus on typography and readability.
3
+ [English](README.md) | [简体中文](README.zh.md)
4
+
5
+ **Amytis** is an elegant, open-source framework for building a personal digital garden: a living knowledge space where ideas grow from raw notes to refined writing. It is built with Next.js 16, React 19, and Tailwind CSS v4, with a strong focus on readability, structure, and long-term content ownership.
4
6
 
5
7
  [**Live Demo**](https://amytis.vercel.app/)
6
8
 
7
9
  ![Amytis Screenshot](public/screenshot.png)
8
10
 
11
+ ## The Knowledge Ladder
12
+
13
+ Amytis is built around a simple path from rough to refined:
14
+
15
+ - **Flow**: Capture raw daily thoughts and fragments.
16
+ - **Articles**: Refine one idea into a clear essay.
17
+ - **Series**: Connect related articles into a curated narrative.
18
+ - **Books**: Distill mature knowledge into structured chapters and parts.
19
+
20
+ Each stage builds on the previous one, so your garden can evolve naturally.
21
+
9
22
  ## Features
10
23
 
11
24
  - **Digital Garden Philosophy:** Non-linear navigation through tags, series, authors, books, flows, and chronological archives.
@@ -48,6 +61,14 @@
48
61
  - **Content CLI Tools:** Create posts, series, and import from PDFs or image folders.
49
62
  - **Modern Stack:** Next.js 16, React 19, Tailwind CSS v4, TypeScript 5, Bun.
50
63
 
64
+ ## Design Philosophy
65
+
66
+ - **Elegance by default**: Typography, spacing, and color should feel intentional out of the box.
67
+ - **Content over configuration**: Writing and publishing should be simple file-based workflows, not CMS-heavy setup.
68
+ - **Markdown-first, not markdown-limited**: Keep authoring portable while supporting rich output (math, diagrams, code, wikilinks).
69
+ - **Ship what you need**: Features are modular through `site.config.ts`; disable sections you do not use.
70
+ - **Plain text, long-term ownership**: Content stays in Markdown/MDX so it remains versionable and portable.
71
+
51
72
  ## Quick Start
52
73
 
53
74
  1. **Install Dependencies:**
@@ -75,38 +96,49 @@
75
96
  ## CLI Commands
76
97
 
77
98
  ```bash
78
- # Development
79
- bun dev # Start dev server at localhost:3000
80
- bun run lint # Run ESLint
81
-
82
- # Build
83
- bun run build # Full production build (copy assets + Next.js build + image optimization)
84
- bun run build:dev # Development build (no image optimization, faster)
85
- bun run clean # Remove .next, out, public/posts directories
86
-
87
- # Testing
88
- bun test # Run all tests
89
- bun run test:unit # Run unit tests (src/)
90
- bun run test:int # Run integration tests
91
- bun run test:e2e # Run end-to-end tests
92
-
93
- # Content creation
94
- bun run new "Post Title" # Create new post (flat file)
95
- bun run new "Title" --folder # Create as folder with index.mdx
96
- bun run new "Title" --prefix weekly # Create with prefix (e.g., weekly-title)
97
- bun run new "Title" --template custom # Use custom template from templates/
98
- bun run new "Title" --md # Create as .md instead of .mdx
99
- bun run new "Title" --series my-series # Create post in a series directory
100
- bun run new-series "Series Name" # Create new series with cover image placeholder
101
- bun run new-from-pdf doc.pdf # Create post from PDF (converts pages to images)
102
- bun run new-from-pdf doc.pdf --title "My Doc" # With custom title
103
- bun run new-from-pdf doc.pdf --scale 3.0 # Higher resolution (default: 2.0)
104
- bun run new-from-images ./photos # Create post from image folder
105
- bun run new-from-images ./photos --title "Gallery" # With custom title
106
- bun run new-from-images ./photos --sort date # Sort by date (default: name)
107
- bun run new-from-images ./photos --no-copy # Reference images instead of copying
99
+ ## Core
100
+ bun dev
101
+ bun run lint
102
+ bun run validate
103
+
104
+ ## Build & Deploy
105
+ bun run build
106
+ bun run build:dev
107
+ bun run clean
108
+ bun run deploy # Deploy to Linux/nginx server (requires .env.local)
109
+
110
+ ## Test
111
+ bun test
112
+ bun run test:unit
113
+ bun run test:int
114
+ bun run test:e2e
115
+
116
+ ## Create Content
117
+ bun run new "Post Title"
118
+ bun run new-series "Series Name"
119
+ bun run new-note "Concept"
120
+ bun run new-flow
121
+
122
+ ## Import / Maintain
123
+ bun run new-from-pdf ./doc.pdf
124
+ bun run new-from-images ./photos
125
+ bun run new-flow-from-chat
126
+ bun run import-book
127
+ bun run sync-book
128
+ bun run series-draft "series-slug"
108
129
  ```
109
130
 
131
+ ### Importing Chat Logs to Flows
132
+
133
+ Drop `.txt` or `.log` files into `imports/chats/`, then run:
134
+
135
+ ```bash
136
+ bun run new-flow-from-chat
137
+ ```
138
+
139
+ Common flags: `--all`, `--dry-run`, `--author "Name"`, `--append`, `--timestamp`.
140
+ Import history is stored in `imports/chats/.imported`.
141
+
110
142
  ## Configuration
111
143
 
112
144
  All site settings are managed in `site.config.ts`:
@@ -178,6 +210,7 @@ amytis/
178
210
  ## Documentation
179
211
 
180
212
  - [Architecture Overview](docs/ARCHITECTURE.md)
213
+ - [Deployment Guide](docs/deployment.md)
181
214
  - [Digital Garden Guide](docs/DIGITAL_GARDEN.md)
182
215
  - [Contributing Guide](docs/CONTRIBUTING.md)
183
216
 
package/README.zh.md ADDED
@@ -0,0 +1,172 @@
1
+ # Amytis
2
+
3
+ [English](README.md) | [简体中文](README.zh.md)
4
+
5
+ **Amytis** 是一个优雅的开源数字花园框架,用于构建个人知识空间。它基于 Next.js 16、React 19 和 Tailwind CSS v4,强调可读性、结构化表达与长期内容所有权。
6
+
7
+ [**在线演示**](https://amytis.vercel.app/)
8
+
9
+ ![Amytis 截图](public/screenshot.png)
10
+
11
+ ## 知识阶梯
12
+
13
+ Amytis 围绕一条从粗糙到精炼的知识路径构建:
14
+
15
+ - **Flow(随笔)**:记录每日想法与碎片。
16
+ - **Articles(文章)**:将单个想法打磨成清晰文章。
17
+ - **Series(系列)**:把相关文章串联为一条主题叙事。
18
+ - **Books(书籍)**:将成熟知识沉淀为章节化结构。
19
+
20
+ 每个阶段都建立在上一阶段之上,花园会自然生长。
21
+
22
+ ## 功能特性
23
+
24
+ - **数字花园体验**:通过标签、系列、作者、书籍、Flow 和归档进行非线性导航。
25
+ - **互联知识网络**:
26
+ - **双向链接**:支持 `[[Slug]]` 跨内容类型关联。
27
+ - **反向链接**:在笔记页自动显示“Linked References”。
28
+ - **知识图谱**:以可视化方式展示内容连接关系。
29
+ - **全文搜索**:基于 Pagefind 的静态搜索,支持 Cmd/Ctrl+K 快捷键。
30
+ - **结构化内容体系**:
31
+ - **Series**:支持手动或自动排序的多篇集合。
32
+ - **Books**:支持章节与分部的长篇阅读界面。
33
+ - **Notes**:原子化常青笔记。
34
+ - **Flows**:流式日记/微记录。
35
+ - **富文本 MDX 能力**:
36
+ - GitHub Flavored Markdown(表格、任务列表等)
37
+ - 代码高亮
38
+ - Mermaid 图表
39
+ - KaTeX 数学公式
40
+ - 原生 HTML 支持
41
+ - **阅读体验与设计**:
42
+ - 高可读排版与响应式布局
43
+ - 自动系统主题检测(明/暗)
44
+ - 四套配色主题:default、blue、rose、amber
45
+ - 吸顶目录与阅读进度跟踪
46
+ - **性能与 SEO**:
47
+ - 全静态导出与 WebP 优化
48
+ - 自动 sitemap 与 RSS
49
+ - 支持 Latin/CJK 的多语言阅读时长估算
50
+ - **集成能力**:
51
+ - 统计:Umami / Plausible / Google Analytics
52
+ - 评论:Giscus / Disqus
53
+ - i18n:`site.config.ts` 中配置多语言(en / zh)
54
+
55
+ ## 设计理念
56
+
57
+ - **默认优雅**:排版、间距、色彩开箱即用且有审美一致性。
58
+ - **内容优先**:通过文件化写作与发布流程完成创作,不依赖重型 CMS。
59
+ - **Markdown 优先但不受限**:保持可迁移写作体验,同时支持数学、图表、代码和双向链接。
60
+ - **按需启用**:`site.config.ts` 提供模块化开关,仅启用你需要的能力。
61
+ - **纯文本长期所有权**:内容存储于 Markdown/MDX,便于版本管理与长期迁移。
62
+
63
+ ## 快速开始
64
+
65
+ 1. **安装依赖**
66
+ ```bash
67
+ bun install
68
+ ```
69
+
70
+ 2. **启动开发环境**
71
+ ```bash
72
+ bun dev
73
+ ```
74
+ 打开 [http://localhost:3000](http://localhost:3000)。
75
+
76
+ 3. **生产构建(静态导出)**
77
+ ```bash
78
+ bun run build
79
+ ```
80
+ 产物位于 `out/` 目录。
81
+
82
+ 4. **开发构建(更快,无图片优化)**
83
+ ```bash
84
+ bun run build:dev
85
+ ```
86
+
87
+ ## CLI 命令
88
+
89
+ ```bash
90
+ ## Core
91
+ bun dev
92
+ bun run lint
93
+ bun run validate
94
+
95
+ ## Build & Deploy
96
+ bun run build
97
+ bun run build:dev
98
+ bun run clean
99
+ bun run deploy # 部署到 Linux/nginx 服务器(需要 .env.local 配置)
100
+
101
+ ## Test
102
+ bun test
103
+ bun run test:unit
104
+ bun run test:int
105
+ bun run test:e2e
106
+
107
+ ## Create Content
108
+ bun run new "Post Title"
109
+ bun run new-series "Series Name"
110
+ bun run new-note "Concept"
111
+ bun run new-flow
112
+
113
+ ## Import / Maintain
114
+ bun run new-from-pdf ./doc.pdf
115
+ bun run new-from-images ./photos
116
+ bun run new-flow-from-chat
117
+ bun run import-book
118
+ bun run sync-book
119
+ bun run series-draft "series-slug"
120
+ ```
121
+
122
+ ### 导入聊天记录到 Flows
123
+
124
+ 将 `.txt` 或 `.log` 文件放入 `imports/chats/` 后执行:
125
+
126
+ ```bash
127
+ bun run new-flow-from-chat
128
+ ```
129
+
130
+ 常用参数:`--all`、`--dry-run`、`--author "Name"`、`--append`、`--timestamp`。
131
+ 导入历史记录位于 `imports/chats/.imported`。
132
+
133
+ ## 配置
134
+
135
+ 所有站点配置集中在 `site.config.ts`。
136
+
137
+ ## 内容写作
138
+
139
+ - **Posts**:创建到 `content/posts/`
140
+ - **Flows**:创建到 `content/flows/YYYY/MM/DD.mdx`(或文件夹模式)
141
+ - **Series**:创建 `content/series/<slug>/index.mdx`
142
+ - **Books**:创建到 `content/books/<slug>/`
143
+ - **Notes**:创建到 `content/notes/`,支持 `[[wiki-links]]`
144
+
145
+ ## 项目结构
146
+
147
+ ```text
148
+ amytis/
149
+ content/
150
+ posts/
151
+ series/
152
+ books/
153
+ notes/
154
+ flows/
155
+ public/
156
+ src/
157
+ app/
158
+ components/
159
+ lib/
160
+ site.config.ts
161
+ ```
162
+
163
+ ## 文档
164
+
165
+ - [架构说明](docs/ARCHITECTURE.md)
166
+ - [部署指南](docs/deployment.md)
167
+ - [数字花园指南](docs/DIGITAL_GARDEN.md)
168
+ - [贡献指南](docs/CONTRIBUTING.md)
169
+
170
+ ## 许可证
171
+
172
+ MIT
package/content/about.mdx CHANGED
@@ -1,24 +1,78 @@
1
1
  ---
2
2
  title: "About Amytis"
3
3
  date: "2026-01-07"
4
- excerpt: "Learn more about the philosophy and technology behind this digital garden."
4
+ excerpt: "Amytis is an elegant open-source framework for building your personal digital garden — from raw daily flows to refined articles, curated series, and structured books."
5
5
  layout: "simple"
6
6
  toc: true
7
7
  ---
8
8
 
9
- # About the Garden
9
+ # What is Amytis?
10
10
 
11
- Amytis is a digital garden designed for long-term thought cultivation. Unlike a blog, which is a stream of consciousness, a digital garden is a network of evolving ideas.
11
+ **Amytis** is an elegant, open-source framework for building a personal digital garden a knowledge space where ideas grow and connect over time. Unlike a traditional blog, a digital garden is a living network of writing at various stages of development: rough notes, refined essays, and everything in between.
12
+
13
+ This site is a live demo. Everything you see — posts, series, books, flow notes, the knowledge graph, and full-text search — is powered by the framework.
14
+
15
+ **[View the source on GitHub →](https://github.com/hutusi/amytis)**
16
+
17
+ ## The Knowledge Ladder
18
+
19
+ Amytis is built around a simple observation: knowledge doesn't arrive fully formed. Ideas follow a natural path from rough to refined:
20
+
21
+ **Flow** — Capture raw thoughts as they happen. Daily notes, fragments, and fleeting observations. The seeds of everything.
22
+
23
+ **Articles** — Refine a single idea into a clear, shareable essay. One thought, fully articulated.
24
+
25
+ **Series** — Gather related articles into a curated collection with a shared thread. A broader argument, explored across multiple pieces.
26
+
27
+ **Books** — Organize mature knowledge into a structured volume with chapters and parts. The most distilled form of an idea.
28
+
29
+ Each stage builds on the last. The garden grows.
30
+
31
+ ## Features
32
+
33
+ - **Articles & Series** — Long-form writing organized into curated, numbered collections
34
+ - **Books** — Multi-chapter content with part grouping and chapter navigation
35
+ - **Flow Notes** — Daily notes with calendar sidebar, year/month browsing, and tag filtering
36
+ - **Knowledge Base** — Atomic notes with `[[wikilink]]` support and a backlinks panel
37
+ - **Knowledge Graph** — D3 force graph visualizing connections across all content
38
+ - **Full-text Search** — Powered by Pagefind, with type filters, recent searches, and keyboard navigation
39
+ - **Table of Contents** — Sticky TOC with scroll-aware reading progress
40
+ - **Multi-language (i18n)** — Built-in English and Chinese, easily extendable
41
+ - **Themes** — Four color palettes: Default, Blue, Rose, and Amber
42
+ - **Comments** — Giscus or Disqus integration
43
+ - **Analytics** — Umami, Plausible, or Google Analytics
44
+ - **RSS Feed** — Automatically generated from your content
12
45
 
13
46
  ## Technology Stack
14
47
 
15
- - **Next.js 15+** for the foundation.
16
- - **Tailwind CSS v4** for styling.
17
- - **MDX** for content rich with React components.
18
- - **Bun** for a lightning-fast development experience.
48
+ - **[Next.js 15+](https://nextjs.org)** App Router, static export, `generateStaticParams`
49
+ - **[React 19](https://react.dev)** Server Components, React Compiler-compatible
50
+ - **[Tailwind CSS v4](https://tailwindcss.com)** CSS variables, theme design tokens
51
+ - **[MDX](https://mdxjs.com)** Markdown with React components, remark/rehype plugin pipeline
52
+ - **[Bun](https://bun.sh)** — Fast package manager and runtime
53
+ - **[Pagefind](https://pagefind.app)** — Static full-text search, no server required
54
+ - **[D3.js](https://d3js.org)** — Knowledge graph visualization
55
+ - **[KaTeX](https://katex.org)** — LaTeX math rendering
56
+
57
+ ## Design Philosophy
58
+
59
+ **Elegance by default.** The typography, spacing, and color system are carefully considered. A fresh Amytis install already looks beautiful — because a garden should be a pleasure to walk through.
60
+
61
+ **Content over configuration.** Drop an MDX file into `content/posts/` and it becomes a post. Series, books, notes, and flows follow the same pattern — no database, no CMS, no build-time magic beyond what Next.js provides natively.
62
+
63
+ **Markdown-first, but not Markdown-limited.** All content is authored in Markdown or MDX — familiar, portable, writable in any editor. Amytis extends the format with syntax highlighting, LaTeX math, Mermaid diagrams, `[[wikilinks]]`, auto-generated tables of contents, and smart excerpts. The writing surface stays simple; the rendered output becomes rich.
64
+
65
+ **Ship what you need, nothing more.** Every feature can be disabled in `site.config.ts`. No books section? No knowledge graph? They simply don't render or generate routes.
66
+
67
+ **Plain text, forever.** All content lives as Markdown or MDX files — version-controlled, portable, and editor-agnostic. Your writing belongs to you.
19
68
 
20
- ## The Philosophy
69
+ ## Get Started
21
70
 
22
- We believe in **Public Learning**. This space is where I plant seeds (initial notes), tend to them (refine and link), and eventually grow them into evergreen articles.
71
+ ```bash
72
+ git clone https://github.com/hutusi/amytis my-garden
73
+ cd my-garden
74
+ bun install
75
+ bun dev
76
+ ```
23
77
 
24
- > "A garden is a grand teacher. It teaches patience and careful watchfulness; it teaches industry and thrift; above all it teaches entire trust." — Gertrude Jekyll
78
+ Edit `site.config.ts` to set your title, navigation, and features. Add content to `content/posts/`. Visit the [GitHub repository](https://github.com/hutusi/amytis) for full documentation and configuration reference.
@@ -1,21 +1,78 @@
1
1
  ---
2
2
  title: "关于 Amytis"
3
3
  date: "2026-01-07"
4
- excerpt: "了解这座数字花园背后的理念与技术。"
4
+ excerpt: "Amytis 是一个优雅的开源数字花园框架——从每日随笔到精炼文章,从系列合集到结构化书籍,层层深化。"
5
5
  layout: "simple"
6
+ toc: true
6
7
  ---
7
8
 
8
- Amytis 是一座为长期思想培育而设计的数字花园。与博客不同,数字花园是一个持续演化的想法网络。
9
+ # Amytis 是什么?
10
+
11
+ **Amytis** 是一个优雅的开源数字花园框架,用于构建个人知识空间。数字花园不同于传统博客——它是一个随时间生长与关联的写作网络,涵盖各个成熟阶段:粗糙的笔记、精炼的文章,以及两者之间的一切。
12
+
13
+ 本站是 Amytis 的在线演示。你所看到的一切——文章、系列、书籍、随笔、知识图谱和全文搜索——均由该框架驱动。
14
+
15
+ **[在 GitHub 上查看源码 →](https://github.com/hutusi/amytis)**
16
+
17
+ ## 知识的阶梯
18
+
19
+ Amytis 的核心是一个简单的观察:知识不会凭空成型,而是沿着一条从粗糙到精炼的自然路径演化:
20
+
21
+ **随笔(Flow)** — 随时记录涌现的想法。每日笔记、碎片、一闪而过的观察。这是一切的种子。
22
+
23
+ **文章(Articles)** — 将单一想法提炼为清晰、可分享的文章。一个思考,完整呈现。
24
+
25
+ **系列(Series)** — 将相关文章整理为有共同主线的精选合集。一个更宏观的论题,通过多篇文章共同探索。
26
+
27
+ **书籍(Books)** — 将成熟的知识组织为结构化的卷册,设有章节与部分。是想法最终蒸馏后的形态。
28
+
29
+ 每一阶段都在上一阶段的基础上生长。花园,就这样繁茂起来。
30
+
31
+ ## 功能特性
32
+
33
+ - **文章与系列** — 长篇写作,整理为有序的精选合集
34
+ - **书籍** — 多章节内容,支持章节分组与导航
35
+ - **随笔** — 日常笔记,含日历侧边栏、年月浏览和标签筛选
36
+ - **知识库** — 原子笔记,支持 `[[双向链接]]` 和反向链接面板
37
+ - **知识图谱** — 基于 D3 的力导向图,可视化所有内容的连接关系
38
+ - **全文搜索** — 由 Pagefind 驱动,支持类型过滤、最近搜索和键盘导航
39
+ - **目录导航** — 滚动感知的阅读进度指示器
40
+ - **多语言(i18n)** — 内置中英文支持,易于扩展
41
+ - **主题色** — 四种配色方案:默认、蓝色、玫瑰、琥珀
42
+ - **评论系统** — 支持 Giscus 或 Disqus
43
+ - **数据统计** — 支持 Umami、Plausible 或 Google Analytics
44
+ - **RSS 订阅** — 根据内容自动生成
9
45
 
10
46
  ## 技术栈
11
47
 
12
- - **Next.js 15+**基础框架
13
- - **Tailwind CSS v4** — 样式系统
14
- - **MDX** — 支持 React 组件的富内容格式
15
- - **Bun** — 极速开发体验
48
+ - **[Next.js 15+](https://nextjs.org)**App Router、静态导出、`generateStaticParams`
49
+ - **[React 19](https://react.dev)** — Server Components,兼容 React Compiler
50
+ - **[Tailwind CSS v4](https://tailwindcss.com)** — CSS 变量,主题设计令牌
51
+ - **[MDX](https://mdxjs.com)** — 支持 React 组件的 Markdown,remark/rehype 插件链路
52
+ - **[Bun](https://bun.sh)** — 高速包管理器与运行时
53
+ - **[Pagefind](https://pagefind.app)** — 静态全文搜索,无需服务端
54
+ - **[D3.js](https://d3js.org)** — 知识图谱可视化
55
+ - **[KaTeX](https://katex.org)** — LaTeX 数学公式渲染
56
+
57
+ ## 设计理念
58
+
59
+ **优雅,开箱即用。** 字体排版、间距和色彩系统经过精心打磨。一个全新的 Amytis 站点天然美观——因为花园本应是令人愉悦的地方。
60
+
61
+ **内容优先,配置从简。** 将 MDX 文件放入 `content/posts/` 即成为文章。系列、书籍、笔记和随笔遵循同样的模式——无需数据库、无需 CMS、无需超出 Next.js 原生能力的构建魔法。
62
+
63
+ **Markdown 优先,但不止于 Markdown。** 所有内容以 Markdown 或 MDX 编写——熟悉、可迁移、随处可写。Amytis 在此基础上扩展了语法高亮、LaTeX 数学公式、Mermaid 图表、`[[双向链接]]`,以及自动生成的目录和摘要。写作界面保持简洁,渲染结果却丰富而强大。
64
+
65
+ **按需取用,不多不少。** 所有功能均可在 `site.config.ts` 中关闭。不需要书籍?不需要知识图谱?它们将不会渲染,也不会生成路由。
66
+
67
+ **纯文本,永久可用。** 所有内容以 Markdown 或 MDX 文件存储——可版本控制、可迁移、编辑器无关。你的写作属于你。
16
68
 
17
- ## 理念
69
+ ## 快速开始
18
70
 
19
- 我们相信**公开学习**的力量。这里是种下种子(初始笔记)、悉心耕耘(提炼与关联)、最终长成长青文章的地方。
71
+ ```bash
72
+ git clone https://github.com/hutusi/amytis my-garden
73
+ cd my-garden
74
+ bun install
75
+ bun dev
76
+ ```
20
77
 
21
- > "花园是最好的老师。它教人耐心与细心观察,教人勤劳与节俭,尤其教人全然的信任。" Gertrude Jekyll
78
+ 编辑 `site.config.ts` 设置标题、导航和功能开关,将内容添加到 `content/posts/`。访问 [GitHub 仓库](https://github.com/hutusi/amytis) 获取完整文档和配置说明。