@hutusi/amytis 1.7.0 → 1.9.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 (83) hide show
  1. package/.github/workflows/ci.yml +1 -1
  2. package/CHANGELOG.md +63 -0
  3. package/CLAUDE.md +9 -18
  4. package/GEMINI.md +6 -0
  5. package/README.md +44 -0
  6. package/TODO.md +15 -3
  7. package/bun.lock +5 -3
  8. package/content/about.mdx +64 -10
  9. package/content/about.zh.mdx +66 -9
  10. package/content/books/sample-book/index.mdx +3 -3
  11. package/content/flows/2026/02/05.md +0 -1
  12. package/content/flows/2026/02/10.mdx +2 -1
  13. package/content/flows/2026/02/15.md +2 -1
  14. package/content/flows/2026/02/18.mdx +2 -1
  15. package/content/flows/2026/02/20.md +0 -1
  16. package/content/notes/algorithms-and-data-structures.mdx +51 -0
  17. package/content/notes/digital-garden-philosophy.mdx +36 -0
  18. package/content/notes/react-server-components.mdx +49 -0
  19. package/content/notes/tailwind-v4.mdx +45 -0
  20. package/content/notes/zettelkasten-method.mdx +33 -0
  21. package/content/series/digital-garden/01-philosophy.mdx +25 -12
  22. package/docs/ARCHITECTURE.md +9 -1
  23. package/docs/CONTRIBUTING.md +26 -0
  24. package/docs/DIGITAL_GARDEN.md +72 -0
  25. package/imports/README.md +45 -0
  26. package/package.json +12 -5
  27. package/scripts/generate-knowledge-graph.ts +162 -0
  28. package/scripts/import-book.ts +176 -0
  29. package/scripts/new-flow-from-chat.ts +238 -0
  30. package/scripts/new-flow.ts +0 -5
  31. package/scripts/new-note.ts +53 -0
  32. package/scripts/sync-book-chapters.ts +210 -0
  33. package/site.config.ts +30 -7
  34. package/src/app/authors/[author]/page.tsx +3 -1
  35. package/src/app/books/[slug]/[chapter]/page.tsx +2 -1
  36. package/src/app/books/[slug]/page.tsx +6 -5
  37. package/src/app/flows/[year]/[month]/[day]/page.tsx +35 -29
  38. package/src/app/flows/[year]/[month]/page.tsx +18 -13
  39. package/src/app/flows/[year]/page.tsx +25 -15
  40. package/src/app/flows/page/[page]/page.tsx +5 -9
  41. package/src/app/flows/page.tsx +5 -8
  42. package/src/app/globals.css +41 -0
  43. package/src/app/graph/page.tsx +21 -0
  44. package/src/app/layout.tsx +4 -2
  45. package/src/app/notes/[slug]/page.tsx +129 -0
  46. package/src/app/notes/page/[page]/page.tsx +60 -0
  47. package/src/app/notes/page.tsx +33 -0
  48. package/src/app/page/[page]/page.tsx +1 -0
  49. package/src/app/page.tsx +4 -5
  50. package/src/app/posts/[slug]/page.tsx +5 -2
  51. package/src/app/posts/page/[page]/page.tsx +4 -1
  52. package/src/app/search.json/route.ts +17 -3
  53. package/src/app/series/[slug]/page/[page]/page.tsx +1 -0
  54. package/src/app/series/[slug]/page.tsx +3 -3
  55. package/src/app/sitemap.ts +1 -1
  56. package/src/app/tags/[tag]/page.tsx +3 -3
  57. package/src/components/Backlinks.tsx +39 -0
  58. package/src/components/BookMobileNav.tsx +11 -11
  59. package/src/components/BookSidebar.tsx +17 -25
  60. package/src/components/BrowserDetectionBanner.tsx +96 -0
  61. package/src/components/FeaturedStoriesSection.tsx +1 -1
  62. package/src/components/FlowCalendarSidebar.tsx +4 -2
  63. package/src/components/FlowContent.tsx +4 -3
  64. package/src/components/FlowHubTabs.tsx +50 -0
  65. package/src/components/FlowTimelineEntry.tsx +7 -9
  66. package/src/components/KnowledgeGraph.tsx +324 -0
  67. package/src/components/LanguageProvider.tsx +14 -5
  68. package/src/components/MarkdownRenderer.tsx +13 -2
  69. package/src/components/Navbar.tsx +237 -10
  70. package/src/components/NoteContent.tsx +123 -0
  71. package/src/components/NoteSidebar.tsx +132 -0
  72. package/src/components/RecentNotesSection.tsx +6 -11
  73. package/src/components/Search.tsx +7 -3
  74. package/src/components/TagContentTabs.tsx +0 -1
  75. package/src/i18n/translations.ts +43 -17
  76. package/src/layouts/BookLayout.tsx +3 -3
  77. package/src/layouts/PostLayout.tsx +8 -3
  78. package/src/lib/i18n.ts +83 -6
  79. package/src/lib/markdown.ts +306 -19
  80. package/src/lib/remark-wikilinks.ts +59 -0
  81. package/src/lib/search-utils.ts +2 -1
  82. package/tests/unit/static-params.test.ts +238 -0
  83. package/content/series/digital-garden/01-philosophy/index.mdx +0 -23
@@ -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,69 @@ 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.9.0] - 2026-02-28
9
+
10
+ ### Added
11
+ - **Book Importer**: Added `bun run import-book` to import GitBook/Markdown-style books into `content/books/` with chapter mapping support.
12
+ - **Flow Chat Import Improvements**: Extended `new-flow-from-chat` with improved formatting and optional timestamp output.
13
+
14
+ ### Changed
15
+ - **Import Reliability**: Hardened `import-book` chapter path and ID handling for mixed source structures.
16
+
17
+ ### Fixed
18
+ - **Author Slug Normalization**: Stabilized `getAuthorSlug` output for bracketed and edge-case names.
19
+ - **Image Path Handling**: Fixed import image-path normalization to correctly handle `../images/`, `./images/`, and `images/` patterns.
20
+ - **Test Consistency**: Aligned static-params mock slug behavior with production logic to avoid CI-only test leakage failures.
21
+
22
+ ## [1.8.0] - 2026-02-24
23
+
24
+ ### Added
25
+ - **Digital Garden Foundation**: Introduced **Notes** (`content/notes/`) as atomic, evergreen units of knowledge.
26
+ - **Interconnected Knowledge**:
27
+ - **Wiki-links**: Native support for `[[Slug]]` and `[[Slug|Display]]` bidirectional linking across all content types.
28
+ - **Backlinks**: Automated "Linked References" display with context snippets for every note.
29
+ - **Knowledge Graph**: Interactive, visual network map of the entire digital garden at `/graph`.
30
+ - **Advanced Navigation**:
31
+ - **'More' Dropdown**: Configurable navbar menu for static child links (Archive, Tags, Links).
32
+ - **Scroll-aware UI**: Navbar now features scroll-triggered transparency and glassmorphism effects.
33
+ - **Active Route Tracking**: Visual indicators for currently active navigation paths.
34
+ - **Mobile Sub-groups**: Grouped navigation links in the mobile drawer for better information hierarchy.
35
+
36
+ ### Changed
37
+ - **Content Experience**: Removed titles from daily Flows for a more immersive, journal-like journal experience.
38
+ - **Layout Evolution**:
39
+ - Promoted `FlowHubTabs` to a primary page heading for easier navigation between Flows, Notes, and Graph.
40
+ - Moved note backlinks and breadcrumbs to the left sidebar for a cleaner, more aligned reading view.
41
+ - **Improved Excerpts**: Refined logic to preserve content within inline code blocks during excerpt generation.
42
+
43
+ ### Fixed
44
+ - **Navbar Stability**: Resolved a flash of transparency on initial mount by initializing scroll state correctly.
45
+ - **Visual Distinction**: Added subtle bracket decorations and consistent hover states for wiki-links.
46
+ - **Static Export**: Fixed handling of empty notes and trailing slashes in active state detection.
47
+
48
+ ## [1.7.0] - 2026-02-21
49
+
50
+ ### Added
51
+ - **Subscription Hub**: Dedicated `/subscribe` page with support for RSS, Email/Substack, Telegram, and WeChat.
52
+ - **Social Sharing**: New configurable `ShareBar` for posts and books with support for 10+ platforms (X, Reddit, Telegram, etc.).
53
+ - **Enhanced Tags UX**:
54
+ - Redesigned tags index with A-Z grouping and popularity badges.
55
+ - Tabbed filtering for "Posts" vs "Flows" within each tag page.
56
+ - Sidebar-driven tag navigation with pagination and search.
57
+ - **Improved Archive**: Redesigned chronological archive with year-based navigation, post counts, and series indicators.
58
+ - **Content Expansion**: New multimedia showcase post and deep-dives on i18n routing strategies.
59
+ - **Author Pages**: Added series contribution tracking and per-author book listings.
60
+
61
+ ### Changed
62
+ - **Homepage Refinement**: Dynamic sections with configurable ordering, scrolling thresholds, and item limits via `site.config.ts`.
63
+ - **Navigation Upgrade**: Segmented pill design for the language switcher and improved mobile drawer.
64
+ - **Documentation**: Synchronized and streamlined `GEMINI.md`, `ARCHITECTURE.md`, and `TODO.md` roadmap.
65
+
66
+ ### Fixed
67
+ - **Engineering**: Resolved multiple race conditions in scroll listeners via a new `useScrollY` singleton hook.
68
+ - **Layout Consistency**: Standardized spacing, dividers, and typography across all content layouts.
69
+ - **i18n Logic**: Fixed locale-specific TOC heading extraction and variant file exclusions.
70
+
8
71
  ## [1.6.0] - 2026-02-20
9
72
 
10
73
  ### Added
package/CLAUDE.md CHANGED
@@ -26,23 +26,14 @@ bun run build:dev # Development build (no image optimization, faster)
26
26
  bun run clean # Remove .next, out, public/posts directories
27
27
 
28
28
  # 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)
29
+ bun run new "Post Title" # Create new post
30
+ bun run new-series "Series Name" # Create new series
31
+ bun run new-from-pdf doc.pdf # Create post from PDF
39
32
  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
33
+ bun run new-flow # Create today's flow note
34
+ bun run new-flow-from-chat # Import all new files from imports/chats/
35
+ bun run sync-book # Sync chapters list for all books from disk
36
+ bun run sync-book <slug> # Sync chapters list for one book
46
37
  ```
47
38
 
48
39
  ## Architecture
@@ -171,11 +162,11 @@ chapters:
171
162
  - part: "Part I: Getting Started" # Optional part grouping
172
163
  chapters:
173
164
  - title: "Chapter Title"
174
- file: "chapter-file" # Maps to chapter-file.mdx in same directory
165
+ id: "chapter-file" # Maps to chapter-file.mdx or chapter-file/index.mdx
175
166
  - part: "Part II: Advanced"
176
167
  chapters:
177
168
  - title: "Another Chapter"
178
- file: "another-chapter"
169
+ id: "another-chapter"
179
170
  ---
180
171
  ```
181
172
 
package/GEMINI.md CHANGED
@@ -67,6 +67,12 @@ bun test
67
67
  - **Cover Images**: Support for local paths, external URLs, and dynamic desaturated gradients (`text:Label`).
68
68
  - **External Links**: Posts can include a list of curated external resources in frontmatter.
69
69
 
70
+ ### Digital Garden Features
71
+ - **Notes**: Atomic, evergreen notes for personal knowledge management (`content/notes/`).
72
+ - **Wiki-links**: Bidirectional linking using `[[Slug]]` syntax across all content types.
73
+ - **Backlinks**: Automatic display of "Linked References" with context snippets.
74
+ - **Knowledge Graph**: Interactive visualization of content relationships at `/graph`.
75
+
70
76
  ### Refined UX & Design
71
77
  - **Homepage**: Elegant layout with "Curated Series" and "Featured Stories" sections using horizontal scroll triggers.
72
78
  - **Navigation**: Command+K fuzzy search, sticky TOC with progress tracking, and Series Catalog sidebars.
package/README.md CHANGED
@@ -9,10 +9,15 @@
9
9
  ## Features
10
10
 
11
11
  - **Digital Garden Philosophy:** Non-linear navigation through tags, series, authors, books, flows, and chronological archives.
12
+ - **Interconnected Knowledge:**
13
+ - **Wiki-links:** Bidirectional linking (`[[Slug]]`) between all content types.
14
+ - **Backlinks:** Automatic "Linked References" display on notes.
15
+ - **Knowledge Graph:** Interactive visual map of your content connections.
12
16
  - **Full-text Search:** Fast, static client-side search across all content (Cmd/Ctrl+K) powered by Pagefind.
13
17
  - **Structured Content:**
14
18
  - **Series:** Multi-part content organization with manual or automatic ordering.
15
19
  - **Books:** Long-form content with explicit chapters, parts, and a dedicated reading interface.
20
+ - **Notes:** Atomic, evergreen concepts for personal knowledge management.
16
21
  - **Flows:** Stream-style daily notes or micro-blogging for quick thoughts.
17
22
  - **Rich MDX Content:**
18
23
  - GitHub Flavored Markdown (tables, task lists, strikethrough).
@@ -100,8 +105,38 @@ bun run new-from-images ./photos # Create post from image folde
100
105
  bun run new-from-images ./photos --title "Gallery" # With custom title
101
106
  bun run new-from-images ./photos --sort date # Sort by date (default: name)
102
107
  bun run new-from-images ./photos --no-copy # Reference images instead of copying
108
+ bun run new-note "Concept" # Create a new atomic note
109
+ bun run new-flow-from-chat # Import all new files in imports/chats/
110
+ bun run sync-book # Sync book chapters with files on disk
111
+ bun run series-draft "series-slug" # Set all posts in a series to draft
112
+ bun run series-draft "series-slug" --undraft # Remove draft status from series posts
103
113
  ```
104
114
 
115
+ ### Importing Chat Logs to Flows
116
+
117
+ Amytis includes a powerful script to convert chat logs (like those from LLMs or messaging apps) into Flow entries.
118
+
119
+ 1. Place your `.txt` or `.log` files in `imports/chats/`.
120
+ 2. Ensure the format is:
121
+ ```
122
+ Author Name YYYY-MM-DD HH:mm:ss
123
+ Message content line 1
124
+ Message content line 2
125
+ ```
126
+ 3. Run the importer:
127
+ ```bash
128
+ bun run new-flow-from-chat
129
+ ```
130
+
131
+ Options:
132
+ - `--all`: Re-import every file (ignores history).
133
+ - `--dry-run`: Preview changes without writing files.
134
+ - `--author "Name"`: Only include messages from a specific author.
135
+ - `--append`: Append to existing flow files instead of skipping.
136
+ - `--timestamp`: Include timestamps in the rendered blocks.
137
+
138
+ Import history is tracked in `imports/chats/.imported`.
139
+
105
140
  ## Configuration
106
141
 
107
142
  All site settings are managed in `site.config.ts`:
@@ -142,6 +177,10 @@ Create a directory in `content/series/` with an `index.mdx`.
142
177
 
143
178
  Books are for long-form, structured content. Create a directory in `content/books/`.
144
179
 
180
+ ### Notes
181
+
182
+ Create evergreen notes in `content/notes/` (e.g., `concept.mdx`). Use `[[wiki-links]]` to connect them.
183
+
145
184
  ## Project Structure
146
185
 
147
186
  ```
@@ -150,21 +189,26 @@ amytis/
150
189
  posts/ # Blog posts
151
190
  series/ # Series collections
152
191
  books/ # Long-form books
192
+ notes/ # Digital garden notes
153
193
  flows/ # Daily notes (YYYY/MM/DD)
154
194
  about.mdx # Static pages
155
195
  public/ # Static assets
156
196
  src/
157
197
  app/ # Next.js App Router pages
158
198
  books/ # Book routes
199
+ notes/ # Note routes
200
+ graph/ # Knowledge graph
159
201
  flows/ # Flow routes
160
202
  components/ # React components
161
203
  lib/
162
204
  markdown.ts # Data access layer
205
+ site.config.ts # Site configuration
163
206
  ```
164
207
 
165
208
  ## Documentation
166
209
 
167
210
  - [Architecture Overview](docs/ARCHITECTURE.md)
211
+ - [Digital Garden Guide](docs/DIGITAL_GARDEN.md)
168
212
  - [Contributing Guide](docs/CONTRIBUTING.md)
169
213
 
170
214
  ## License
package/TODO.md CHANGED
@@ -5,13 +5,25 @@
5
5
  - [ ] **Breadcrumbs**: Extend Flow breadcrumbs to standard Posts and Books.
6
6
  - [ ] **Dynamic OG**: Generate automated social cards with Satori for every post.
7
7
  - [ ] **PWA Support**: Add manifest and service worker for offline reading.
8
+ - [ ] **SEO Boost**: Implement JSON-LD structured data for Articles, Books, and Breadcrumbs.
8
9
 
9
10
  ## 🌿 Digital Garden Evolution
10
- - [ ] **Backlinks**: Automatically list "Pages that link here" at the bottom of articles.
11
- - [ ] **Wiki-links**: Support `[[internal-link]]` syntax for easier cross-referencing.
12
- - [ ] **Knowledge Graph**: Interactive visual map of all connected notes.
11
+ - [ ] **Knowledge Graph**:
12
+ - [ ] Interactive fullscreen mode for the graph.
13
+ - [ ] Filter graph by tags or content types.
14
+ - [ ] "Local Graph" view in the sidebar of individual notes.
15
+ - [ ] **Discovery**:
16
+ - [ ] "On this day" section for Flows (history from previous years).
17
+ - [ ] RSS/Atom feeds for specific categories or tags.
18
+ - [ ] **Notes**: Support for un-linked mentions (searching for note titles in plain text).
19
+
20
+ ## 🛠 Tooling & Maintenance
21
+ - [ ] **Link Validator**: Script to check for broken internal wiki-links and external URLs.
22
+ - [ ] **Content Porter**: Tool to import/export notes from Obsidian or Notion.
23
+ - [ ] **Optimization**: Automatically compress and resize co-located images during build.
13
24
 
14
25
  ## ✅ Completed Highlights
26
+ - [x] **Digital Garden**: Notes, Wiki-links, Backlinks, and interactive Knowledge Graph.
15
27
  - [x] **Pagefind Search**: High-performance static full-text indexing with rich UI.
16
28
  - [x] **Smart Navigation**: Persistent "Previous" and "Next" article links on all posts.
17
29
  - [x] **Multi-format Content**: Native support for **Posts**, **Series**, **Books**, and **Flows**.
package/bun.lock CHANGED
@@ -7,6 +7,7 @@
7
7
  "dependencies": {
8
8
  "@giscus/react": "^3.1.0",
9
9
  "@tailwindcss/typography": "^0.5.19",
10
+ "d3": "^7.9.0",
10
11
  "github-slugger": "^2.0.0",
11
12
  "gray-matter": "^4.0.3",
12
13
  "image-size": "^2.0.2",
@@ -30,6 +31,7 @@
30
31
  "devDependencies": {
31
32
  "@tailwindcss/postcss": "^4.1.18",
32
33
  "@types/bun": "^1.3.9",
34
+ "@types/d3": "^7.4.3",
33
35
  "@types/image-size": "^0.8.0",
34
36
  "@types/node": "^24.10.13",
35
37
  "@types/react": "^19.2.14",
@@ -556,7 +558,7 @@
556
558
 
557
559
  "comma-separated-tokens": ["comma-separated-tokens@2.0.3", "", {}, "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg=="],
558
560
 
559
- "commander": ["commander@8.3.0", "", {}, "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww=="],
561
+ "commander": ["commander@7.2.0", "", {}, "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw=="],
560
562
 
561
563
  "concat-map": ["concat-map@0.0.1", "", {}, "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="],
562
564
 
@@ -1502,8 +1504,6 @@
1502
1504
 
1503
1505
  "cytoscape-fcose/cose-base": ["cose-base@2.2.0", "", { "dependencies": { "layout-base": "^2.0.0" } }, "sha512-AzlgcsCbUMymkADOJtQm3wO9S3ltPfYOFD5033keQn9NJzIbtnZj+UdBJe7DYml/8TdbtHJW3j58SOnKhWY/5g=="],
1504
1506
 
1505
- "d3-dsv/commander": ["commander@7.2.0", "", {}, "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw=="],
1506
-
1507
1507
  "d3-sankey/d3-array": ["d3-array@2.12.1", "", { "dependencies": { "internmap": "^1.0.0" } }, "sha512-B0ErZK/66mHtEsR1TkPEEkwdy+WDesimkM5gpZr5Dsg54BiTA5RXtYW5qTLIAcekaS9xfZrzBLF/OAkB3Qn1YQ=="],
1508
1508
 
1509
1509
  "d3-sankey/d3-shape": ["d3-shape@1.3.7", "", { "dependencies": { "d3-path": "1" } }, "sha512-EUkvKjqPFUAZyOlhY5gzCxCeI0Aep04LwIRpsZ/mLFelJiUfnK56jo5JMDSE7yyP2kLSb6LtF+S5chMk7uqPqw=="],
@@ -1520,6 +1520,8 @@
1520
1520
 
1521
1521
  "is-bun-module/semver": ["semver@7.7.3", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q=="],
1522
1522
 
1523
+ "katex/commander": ["commander@8.3.0", "", {}, "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww=="],
1524
+
1523
1525
  "mdast-util-find-and-replace/escape-string-regexp": ["escape-string-regexp@5.0.0", "", {}, "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw=="],
1524
1526
 
1525
1527
  "micromatch/picomatch": ["picomatch@2.3.1", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="],
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) 获取完整文档和配置说明。
@@ -10,13 +10,13 @@ chapters:
10
10
  - part: "Part I: Getting Started"
11
11
  chapters:
12
12
  - title: "Introduction to Digital Gardens"
13
- file: "introduction"
13
+ id: "introduction"
14
14
  - title: "Setting Up Your Garden"
15
- file: "setup"
15
+ id: "setup"
16
16
  - part: "Part II: Growing Your Garden"
17
17
  chapters:
18
18
  - title: "Writing and Organizing Content"
19
- file: "writing-content"
19
+ id: "writing-content"
20
20
  ---
21
21
 
22
22
  Welcome to **The Digital Garden Handbook**. This book will guide you through the philosophy, setup, and maintenance of a digital garden — a personal knowledge base that grows organically over time.
@@ -1,5 +1,4 @@
1
1
  ---
2
- title: "Bun as a Package Manager"
3
2
  tags: ["tooling", "bun"]
4
3
  ---
5
4
 
@@ -1,8 +1,9 @@
1
1
  ---
2
- title: "On Digital Gardens"
3
2
  tags: ["writing", "digital-garden"]
4
3
  ---
5
4
 
6
5
  Been thinking about the difference between blogs and digital gardens. Blogs are streams — chronological, finished thoughts published into the void. Gardens are networks — interconnected ideas that grow and evolve over time.
7
6
 
8
7
  This site tries to bridge both: structured posts for polished essays, and this flow section for raw, daily observations. The garden metaphor resonates because ideas really do need tending.
8
+
9
+ The [[zettelkasten-method]] is the underlying system that makes a garden actually work — atomic notes linked by meaning rather than filed in folders. And [[digital-garden-philosophy]] explores why publishing half-formed ideas in public is worth the discomfort.
@@ -1,8 +1,9 @@
1
1
  ---
2
- title: "Tailwind CSS v4 First Impressions"
3
2
  tags: ["css", "tailwind"]
4
3
  ---
5
4
 
6
5
  Upgraded the project to Tailwind CSS v4 today. The new CSS-first configuration approach is a breath of fresh air — no more `tailwind.config.js` for most use cases.
7
6
 
8
7
  The `@theme` directive for defining design tokens directly in CSS feels much more natural. Performance improvements are noticeable too, especially during development with faster HMR.
8
+
9
+ More detailed notes captured in [[tailwind-v4]] — particularly the breaking changes around dark mode and `@apply`.
@@ -1,5 +1,4 @@
1
1
  ---
2
- title: "Exploring React Server Components"
3
2
  tags: ["react", "notes"]
4
3
  ---
5
4
 
@@ -12,3 +11,5 @@ Spent some time digging into React Server Components today. The mental model shi
12
11
  - Data fetching becomes much simpler without `useEffect` chains
13
12
 
14
13
  The composability of mixing server and client components in the same tree is elegant once you get used to it.
14
+
15
+ Writing up a fuller note on this: [[react-server-components]].
@@ -1,5 +1,4 @@
1
1
  ---
2
- title: "Multimedia embeds in markdown"
3
2
  tags: ["video", "podcast", "markdown", "web"]
4
3
  ---
5
4
 
@@ -0,0 +1,51 @@
1
+ ---
2
+ title: "Algorithms and Data Structures"
3
+ date: "2026-01-28"
4
+ tags: ["algorithms", "computer-science", "fundamentals"]
5
+ aliases: ["algorithms"]
6
+ ---
7
+
8
+ Algorithms and data structures are the grammar of computation. You can write software without thinking about them explicitly, but the moment performance matters — or the problem gets hard — you need this vocabulary.
9
+
10
+ ## Why They Still Matter
11
+
12
+ Modern abstractions (ORMs, high-level languages, framework magic) can obscure algorithmic complexity. But complexity doesn't disappear — it hides. A seemingly innocent nested loop in an ORM query is still O(n²). Knowing the fundamentals lets you see through the abstractions.
13
+
14
+ ## The Core Data Structures
15
+
16
+ **Arrays** — contiguous memory, O(1) random access, O(n) insertion. The foundation of almost everything else.
17
+
18
+ **Linked lists** — O(1) insertion at head, O(n) random access. Useful when you need frequent insertion/deletion and don't need random access.
19
+
20
+ **Hash maps** — amortized O(1) for insert, lookup, delete. The most-used data structure in practice. Collision resolution strategy matters.
21
+
22
+ **Trees** — hierarchical structure. Binary search trees give O(log n) operations when balanced. The key insight: balance is not automatic.
23
+
24
+ **Heaps** — a tree where every parent is ≥ (max-heap) or ≤ (min-heap) its children. The natural implementation of a priority queue.
25
+
26
+ **Graphs** — the most general structure. Almost every interesting problem is a graph problem in disguise.
27
+
28
+ ## Sorting as a Lens
29
+
30
+ Sorting algorithms are pedagogically valuable because they expose different algorithmic strategies in a simple domain:
31
+
32
+ - **Insertion sort** — O(n²) worst case, but excellent on nearly-sorted data
33
+ - **Merge sort** — O(n log n) guaranteed, stable, but O(n) extra space
34
+ - **QuickSort** — O(n log n) average, O(n²) worst case, but cache-friendly and in-place
35
+ - **HeapSort** — O(n log n) guaranteed, O(1) space, but not stable and poor cache behavior
36
+
37
+ The [[the-art-of-algorithms|QuickSort deep dive]] post covers the implementation and visualization in detail.
38
+
39
+ ## Complexity Intuition
40
+
41
+ A useful mental model: for n = 1,000,000 operations per second,
42
+
43
+ | Complexity | n=1000 | n=1,000,000 |
44
+ |-----------|--------|-------------|
45
+ | O(1) | instant | instant |
46
+ | O(log n) | ~10 ops | ~20 ops |
47
+ | O(n) | 1ms | 1s |
48
+ | O(n log n)| ~10ms | ~20s |
49
+ | O(n²) | 1s | 11.5 days |
50
+
51
+ This table should be tattooed on the inside of every programmer's eyelids.
@@ -0,0 +1,36 @@
1
+ ---
2
+ title: "Digital Garden Philosophy"
3
+ date: "2026-02-03"
4
+ tags: ["digital-garden", "writing", "knowledge-management"]
5
+ aliases: ["digital-gardens"]
6
+ ---
7
+
8
+ A digital garden is a different way of thinking about a personal website. Unlike a blog — where posts are dated, finished, and pushed into a feed — a garden is a space of growing, evolving ideas.
9
+
10
+ ## The Garden vs. The Stream
11
+
12
+ The stream metaphor (Twitter, blogs, newsletters) privileges recency. New things rise, old things sink. The garden metaphor privileges *connection*. Notes link to other notes; ideas accrete over time.
13
+
14
+ Mike Caulfield's 2015 talk "The Garden and the Stream" is the canonical introduction to this distinction. He argues the stream has colonized how we think about the web, and that the garden offers a richer alternative.
15
+
16
+ ## Epistemic States
17
+
18
+ In a garden, notes can exist at different stages of development:
19
+
20
+ - **Seedling** — rough, barely-formed idea
21
+ - **Budding** — developing, but incomplete
22
+ - **Evergreen** — mature and stable (but still revisable)
23
+
24
+ Publishing work-in-progress is uncomfortable at first. But it's honest, and it invites readers to engage with thinking rather than just conclusions.
25
+
26
+ ## This Garden
27
+
28
+ [[welcome-to-amytis|This site's founding post]] describes the original intent. The notes section implements the garden layer on top of the existing blog structure.
29
+
30
+ The underlying method is [[zettelkasten-method|Zettelkasten]]: atomic notes, linked by meaning rather than filed by category. The result is a network of ideas that can be navigated in any direction — following curiosity rather than chronology.
31
+
32
+ ## Further Reading
33
+
34
+ - Mike Caulfield, *The Garden and the Stream: A Technopastoral*
35
+ - Maggie Appleton's digital garden theory essays
36
+ - Andy Matuschak's notes on evergreen note-writing