@hutusi/amytis 1.6.0 → 1.8.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 (92) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/GEMINI.md +12 -2
  3. package/README.md +14 -0
  4. package/TODO.md +24 -16
  5. package/bun.lock +8 -3
  6. package/content/about.mdx +1 -0
  7. package/content/about.zh.mdx +21 -0
  8. package/content/flows/2026/02/05.md +0 -1
  9. package/content/flows/2026/02/10.mdx +2 -1
  10. package/content/flows/2026/02/15.md +2 -1
  11. package/content/flows/2026/02/18.mdx +2 -1
  12. package/content/flows/2026/02/20.md +15 -0
  13. package/content/links.mdx +42 -0
  14. package/content/links.zh.mdx +41 -0
  15. package/content/notes/algorithms-and-data-structures.mdx +51 -0
  16. package/content/notes/digital-garden-philosophy.mdx +36 -0
  17. package/content/notes/react-server-components.mdx +49 -0
  18. package/content/notes/tailwind-v4.mdx +45 -0
  19. package/content/notes/zettelkasten-method.mdx +33 -0
  20. package/content/posts/2026-02-20-i18n-routing-considerations.mdx +150 -0
  21. package/content/posts/multimedia-showcase/index.mdx +261 -0
  22. package/content/privacy.mdx +32 -0
  23. package/content/privacy.zh.mdx +32 -0
  24. package/docs/ARCHITECTURE.md +16 -0
  25. package/docs/CONTRIBUTING.md +11 -0
  26. package/docs/DIGITAL_GARDEN.md +64 -0
  27. package/package.json +8 -3
  28. package/scripts/copy-assets.ts +1 -1
  29. package/scripts/generate-knowledge-graph.ts +162 -0
  30. package/scripts/new-flow.ts +0 -5
  31. package/scripts/new-note.ts +53 -0
  32. package/site.config.ts +146 -44
  33. package/src/app/[slug]/page.tsx +0 -10
  34. package/src/app/archive/page.tsx +38 -10
  35. package/src/app/books/[slug]/page.tsx +18 -0
  36. package/src/app/flows/[year]/[month]/[day]/page.tsx +51 -31
  37. package/src/app/flows/[year]/[month]/page.tsx +15 -13
  38. package/src/app/flows/[year]/page.tsx +22 -15
  39. package/src/app/flows/page/[page]/page.tsx +3 -9
  40. package/src/app/flows/page.tsx +3 -8
  41. package/src/app/globals.css +41 -0
  42. package/src/app/graph/page.tsx +19 -0
  43. package/src/app/layout.tsx +47 -21
  44. package/src/app/notes/[slug]/page.tsx +128 -0
  45. package/src/app/notes/page/[page]/page.tsx +58 -0
  46. package/src/app/notes/page.tsx +31 -0
  47. package/src/app/page.tsx +134 -72
  48. package/src/app/posts/[slug]/page.tsx +8 -12
  49. package/src/app/search.json/route.ts +15 -1
  50. package/src/app/series/[slug]/page.tsx +18 -0
  51. package/src/app/subscribe/page.tsx +17 -0
  52. package/src/app/tags/[tag]/page.tsx +9 -26
  53. package/src/app/tags/page.tsx +3 -8
  54. package/src/components/AuthorCard.tsx +43 -0
  55. package/src/components/Backlinks.tsx +39 -0
  56. package/src/components/Comments.tsx +20 -4
  57. package/src/components/ExternalLinks.tsx +6 -2
  58. package/src/components/FlowCalendarSidebar.tsx +4 -2
  59. package/src/components/FlowContent.tsx +4 -3
  60. package/src/components/FlowHubTabs.tsx +50 -0
  61. package/src/components/FlowTimelineEntry.tsx +7 -9
  62. package/src/components/Footer.tsx +35 -26
  63. package/src/components/KnowledgeGraph.tsx +324 -0
  64. package/src/components/LanguageProvider.tsx +0 -5
  65. package/src/components/LanguageSwitch.tsx +117 -6
  66. package/src/components/LocaleSwitch.tsx +33 -0
  67. package/src/components/MarkdownRenderer.tsx +13 -2
  68. package/src/components/Navbar.tsx +266 -17
  69. package/src/components/NoteContent.tsx +123 -0
  70. package/src/components/NoteSidebar.tsx +132 -0
  71. package/src/components/PostNavigation.tsx +55 -0
  72. package/src/components/PostSidebar.tsx +172 -126
  73. package/src/components/ReadingProgressBar.tsx +6 -21
  74. package/src/components/RecentNotesSection.tsx +6 -11
  75. package/src/components/RelatedPosts.tsx +1 -1
  76. package/src/components/Search.tsx +29 -5
  77. package/src/components/SelectedBooksSection.tsx +12 -6
  78. package/src/components/ShareBar.tsx +115 -0
  79. package/src/components/SimpleLayoutHeader.tsx +5 -14
  80. package/src/components/SubscribePage.tsx +298 -0
  81. package/src/components/TagContentTabs.tsx +102 -0
  82. package/src/components/TagPageHeader.tsx +7 -13
  83. package/src/components/TagSidebar.tsx +142 -0
  84. package/src/components/TagsIndexClient.tsx +156 -0
  85. package/src/hooks/useScrollY.ts +41 -0
  86. package/src/i18n/translations.ts +105 -1
  87. package/src/layouts/PostLayout.tsx +40 -8
  88. package/src/layouts/SimpleLayout.tsx +53 -15
  89. package/src/lib/markdown.ts +347 -18
  90. package/src/lib/remark-wikilinks.ts +59 -0
  91. package/src/lib/search-utils.ts +2 -1
  92. package/src/components/TableOfContents.tsx +0 -158
package/CHANGELOG.md CHANGED
@@ -5,6 +5,55 @@ 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.8.0] - 2026-02-24
9
+
10
+ ### Added
11
+ - **Digital Garden Foundation**: Introduced **Notes** (`content/notes/`) as atomic, evergreen units of knowledge.
12
+ - **Interconnected Knowledge**:
13
+ - **Wiki-links**: Native support for `[[Slug]]` and `[[Slug|Display]]` bidirectional linking across all content types.
14
+ - **Backlinks**: Automated "Linked References" display with context snippets for every note.
15
+ - **Knowledge Graph**: Interactive, visual network map of the entire digital garden at `/graph`.
16
+ - **Advanced Navigation**:
17
+ - **'More' Dropdown**: Configurable navbar menu for static child links (Archive, Tags, Links).
18
+ - **Scroll-aware UI**: Navbar now features scroll-triggered transparency and glassmorphism effects.
19
+ - **Active Route Tracking**: Visual indicators for currently active navigation paths.
20
+ - **Mobile Sub-groups**: Grouped navigation links in the mobile drawer for better information hierarchy.
21
+
22
+ ### Changed
23
+ - **Content Experience**: Removed titles from daily Flows for a more immersive, journal-like journal experience.
24
+ - **Layout Evolution**:
25
+ - Promoted `FlowHubTabs` to a primary page heading for easier navigation between Flows, Notes, and Graph.
26
+ - Moved note backlinks and breadcrumbs to the left sidebar for a cleaner, more aligned reading view.
27
+ - **Improved Excerpts**: Refined logic to preserve content within inline code blocks during excerpt generation.
28
+
29
+ ### Fixed
30
+ - **Navbar Stability**: Resolved a flash of transparency on initial mount by initializing scroll state correctly.
31
+ - **Visual Distinction**: Added subtle bracket decorations and consistent hover states for wiki-links.
32
+ - **Static Export**: Fixed handling of empty notes and trailing slashes in active state detection.
33
+
34
+ ## [1.7.0] - 2026-02-21
35
+
36
+ ### Added
37
+ - **Subscription Hub**: Dedicated `/subscribe` page with support for RSS, Email/Substack, Telegram, and WeChat.
38
+ - **Social Sharing**: New configurable `ShareBar` for posts and books with support for 10+ platforms (X, Reddit, Telegram, etc.).
39
+ - **Enhanced Tags UX**:
40
+ - Redesigned tags index with A-Z grouping and popularity badges.
41
+ - Tabbed filtering for "Posts" vs "Flows" within each tag page.
42
+ - Sidebar-driven tag navigation with pagination and search.
43
+ - **Improved Archive**: Redesigned chronological archive with year-based navigation, post counts, and series indicators.
44
+ - **Content Expansion**: New multimedia showcase post and deep-dives on i18n routing strategies.
45
+ - **Author Pages**: Added series contribution tracking and per-author book listings.
46
+
47
+ ### Changed
48
+ - **Homepage Refinement**: Dynamic sections with configurable ordering, scrolling thresholds, and item limits via `site.config.ts`.
49
+ - **Navigation Upgrade**: Segmented pill design for the language switcher and improved mobile drawer.
50
+ - **Documentation**: Synchronized and streamlined `GEMINI.md`, `ARCHITECTURE.md`, and `TODO.md` roadmap.
51
+
52
+ ### Fixed
53
+ - **Engineering**: Resolved multiple race conditions in scroll listeners via a new `useScrollY` singleton hook.
54
+ - **Layout Consistency**: Standardized spacing, dividers, and typography across all content layouts.
55
+ - **i18n Logic**: Fixed locale-specific TOC heading extraction and variant file exclusions.
56
+
8
57
  ## [1.6.0] - 2026-02-20
9
58
 
10
59
  ### Added
package/GEMINI.md CHANGED
@@ -43,9 +43,13 @@ bun test
43
43
  - `archive/`: Timeline-based chronological archive grouped by year and month.
44
44
  - `tags/`: Popularity-sorted tag cloud and filtered listings.
45
45
  - `authors/`: Posts filtered by individual authors.
46
+ - `subscribe/`: Subscription options (RSS, Newsletter, Social).
47
+ - `search.json/`: Static search index generator (supplementary).
46
48
  - `src/lib/`: Core logic and utilities.
47
- - `markdown.ts`: Advanced parsing for posts/series/flows, sorting, reading time calculation (multilingual), and metadata inheritance.
48
- - `src/components/`: Modular UI blocks (Hero, HorizontalScroll, Search, CoverImage, etc.).
49
+ - `markdown.ts`: Advanced parsing for posts/series/flows, sorting, and metadata.
50
+ - `search-utils.ts`: Content cleaning and search result processing.
51
+ - `shuffle.ts`: Deterministic and random array shuffling.
52
+ - `src/components/`: Modular UI blocks (Hero, HorizontalScroll, Search, CoverImage, ShareBar, etc.).
49
53
  - `content/`: Source Markdown/MDX content.
50
54
  - `scripts/`: CLI tools for content management and asset processing.
51
55
 
@@ -63,6 +67,12 @@ bun test
63
67
  - **Cover Images**: Support for local paths, external URLs, and dynamic desaturated gradients (`text:Label`).
64
68
  - **External Links**: Posts can include a list of curated external resources in frontmatter.
65
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
+
66
76
  ### Refined UX & Design
67
77
  - **Homepage**: Elegant layout with "Curated Series" and "Featured Stories" sections using horizontal scroll triggers.
68
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).
@@ -142,6 +147,10 @@ Create a directory in `content/series/` with an `index.mdx`.
142
147
 
143
148
  Books are for long-form, structured content. Create a directory in `content/books/`.
144
149
 
150
+ ### Notes
151
+
152
+ Create evergreen notes in `content/notes/` (e.g., `concept.mdx`). Use `[[wiki-links]]` to connect them.
153
+
145
154
  ## Project Structure
146
155
 
147
156
  ```
@@ -150,21 +159,26 @@ amytis/
150
159
  posts/ # Blog posts
151
160
  series/ # Series collections
152
161
  books/ # Long-form books
162
+ notes/ # Digital garden notes
153
163
  flows/ # Daily notes (YYYY/MM/DD)
154
164
  about.mdx # Static pages
155
165
  public/ # Static assets
156
166
  src/
157
167
  app/ # Next.js App Router pages
158
168
  books/ # Book routes
169
+ notes/ # Note routes
170
+ graph/ # Knowledge graph
159
171
  flows/ # Flow routes
160
172
  components/ # React components
161
173
  lib/
162
174
  markdown.ts # Data access layer
175
+ site.config.ts # Site configuration
163
176
  ```
164
177
 
165
178
  ## Documentation
166
179
 
167
180
  - [Architecture Overview](docs/ARCHITECTURE.md)
181
+ - [Digital Garden Guide](docs/DIGITAL_GARDEN.md)
168
182
  - [Contributing Guide](docs/CONTRIBUTING.md)
169
183
 
170
184
  ## License
package/TODO.md CHANGED
@@ -1,25 +1,33 @@
1
1
  # Amytis Roadmap
2
2
 
3
- ## 🚀 Immediate UX & Polish
4
- - [ ] **Interactive Code**: Add "Copy to Clipboard" buttons to code blocks.
3
+ ## 🚀 Priority UX & Engineering
5
4
  - [ ] **Image Zoom**: Implement medium-zoom or a lightbox for MDX images.
6
- - [ ] **Breadcrumbs**: Add path navigation (e.g., `Home > Books > Chapter`) to all pages.
7
- - [ ] **Smart Nav**: Add "Previous" and "Next" article links at the bottom of posts.
5
+ - [ ] **Breadcrumbs**: Extend Flow breadcrumbs to standard Posts and Books.
6
+ - [ ] **Dynamic OG**: Generate automated social cards with Satori for every post.
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
- - [ ] **Recent Notes**: Integrate a "Recent Flows" section on the homepage.
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).
13
19
 
14
- ## 🛠 Performance & Social
15
- - [ ] **Dynamic OG**: Generate automated social cards with Satori based on post titles.
16
- - [ ] **PWA**: Add a manifest and service worker for basic offline reading support.
17
- - [ ] **Search UI**: Refine Pagefind results with highlighted context and better mobile layout.
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.
18
24
 
19
25
  ## ✅ Completed Highlights
20
- - [x] **Full-text Search**: Migrated to **Pagefind** for high-performance static indexing.
26
+ - [x] **Digital Garden**: Notes, Wiki-links, Backlinks, and interactive Knowledge Graph.
27
+ - [x] **Pagefind Search**: High-performance static full-text indexing with rich UI.
28
+ - [x] **Smart Navigation**: Persistent "Previous" and "Next" article links on all posts.
21
29
  - [x] **Multi-format Content**: Native support for **Posts**, **Series**, **Books**, and **Flows**.
22
- - [x] **Scoped Publishing**: Official release as `@hutusi/amytis` on npm and GitHub.
23
- - [x] **Robust Engineering**: Zero hydration mismatches, full Zod validation, and 64+ automated tests.
24
- - [x] **Refined UI**: High-contrast typography, four color palettes, and horizontal featured scrolling.
25
- - [x] **Asset Pipeline**: Automatic co-located image mapping and WebP optimization.
30
+ - [x] **Professional Publishing**: Scoped `@hutusi/amytis` package with OIDC Trusted Publishing.
31
+ - [x] **Robust Engineering**: Zero hydration mismatches, Zod validation, and 64+ automated tests.
32
+ - [x] **Refined UI**: High-contrast typography, four color palettes, and horizontal scroll featured sections.
33
+ - [x] **Sub-features**: Newsletter/Subscribe page, Reading Progress, and Author Ecosystem.
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",
@@ -16,6 +17,7 @@
16
17
  "next-themes": "^0.4.6",
17
18
  "react": "19.2.4",
18
19
  "react-dom": "19.2.4",
20
+ "react-icons": "^5.5.0",
19
21
  "react-markdown": "^10.1.0",
20
22
  "react-syntax-highlighter": "^16.1.0",
21
23
  "rehype-katex": "^7.0.1",
@@ -29,6 +31,7 @@
29
31
  "devDependencies": {
30
32
  "@tailwindcss/postcss": "^4.1.18",
31
33
  "@types/bun": "^1.3.9",
34
+ "@types/d3": "^7.4.3",
32
35
  "@types/image-size": "^0.8.0",
33
36
  "@types/node": "^24.10.13",
34
37
  "@types/react": "^19.2.14",
@@ -555,7 +558,7 @@
555
558
 
556
559
  "comma-separated-tokens": ["comma-separated-tokens@2.0.3", "", {}, "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg=="],
557
560
 
558
- "commander": ["commander@8.3.0", "", {}, "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww=="],
561
+ "commander": ["commander@7.2.0", "", {}, "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw=="],
559
562
 
560
563
  "concat-map": ["concat-map@0.0.1", "", {}, "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="],
561
564
 
@@ -1237,6 +1240,8 @@
1237
1240
 
1238
1241
  "react-dom": ["react-dom@19.2.4", "", { "dependencies": { "scheduler": "^0.27.0" }, "peerDependencies": { "react": "^19.2.4" } }, "sha512-AXJdLo8kgMbimY95O2aKQqsz2iWi9jMgKJhRBAxECE4IFxfcazB2LmzloIoibJI3C12IlY20+KFaLv+71bUJeQ=="],
1239
1242
 
1243
+ "react-icons": ["react-icons@5.5.0", "", { "peerDependencies": { "react": "*" } }, "sha512-MEFcXdkP3dLo8uumGI5xN3lDFNsRtrjbOEKDLD7yv76v4wpnEq2Lt2qeHaQOr34I/wPN3s3+N08WkQ+CW37Xiw=="],
1244
+
1240
1245
  "react-is": ["react-is@16.13.1", "", {}, "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="],
1241
1246
 
1242
1247
  "react-markdown": ["react-markdown@10.1.0", "", { "dependencies": { "@types/hast": "^3.0.0", "@types/mdast": "^4.0.0", "devlop": "^1.0.0", "hast-util-to-jsx-runtime": "^2.0.0", "html-url-attributes": "^3.0.0", "mdast-util-to-hast": "^13.0.0", "remark-parse": "^11.0.0", "remark-rehype": "^11.0.0", "unified": "^11.0.0", "unist-util-visit": "^5.0.0", "vfile": "^6.0.0" }, "peerDependencies": { "@types/react": ">=18", "react": ">=18" } }, "sha512-qKxVopLT/TyA6BX3Ue5NwabOsAzm0Q7kAPwq6L+wWDwisYs7R8vZ0nRXqq6rkueboxpkjvLGU9fWifiX/ZZFxQ=="],
@@ -1499,8 +1504,6 @@
1499
1504
 
1500
1505
  "cytoscape-fcose/cose-base": ["cose-base@2.2.0", "", { "dependencies": { "layout-base": "^2.0.0" } }, "sha512-AzlgcsCbUMymkADOJtQm3wO9S3ltPfYOFD5033keQn9NJzIbtnZj+UdBJe7DYml/8TdbtHJW3j58SOnKhWY/5g=="],
1501
1506
 
1502
- "d3-dsv/commander": ["commander@7.2.0", "", {}, "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw=="],
1503
-
1504
1507
  "d3-sankey/d3-array": ["d3-array@2.12.1", "", { "dependencies": { "internmap": "^1.0.0" } }, "sha512-B0ErZK/66mHtEsR1TkPEEkwdy+WDesimkM5gpZr5Dsg54BiTA5RXtYW5qTLIAcekaS9xfZrzBLF/OAkB3Qn1YQ=="],
1505
1508
 
1506
1509
  "d3-sankey/d3-shape": ["d3-shape@1.3.7", "", { "dependencies": { "d3-path": "1" } }, "sha512-EUkvKjqPFUAZyOlhY5gzCxCeI0Aep04LwIRpsZ/mLFelJiUfnK56jo5JMDSE7yyP2kLSb6LtF+S5chMk7uqPqw=="],
@@ -1517,6 +1520,8 @@
1517
1520
 
1518
1521
  "is-bun-module/semver": ["semver@7.7.3", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q=="],
1519
1522
 
1523
+ "katex/commander": ["commander@8.3.0", "", {}, "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww=="],
1524
+
1520
1525
  "mdast-util-find-and-replace/escape-string-regexp": ["escape-string-regexp@5.0.0", "", {}, "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw=="],
1521
1526
 
1522
1527
  "micromatch/picomatch": ["picomatch@2.3.1", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="],
package/content/about.mdx CHANGED
@@ -3,6 +3,7 @@ title: "About Amytis"
3
3
  date: "2026-01-07"
4
4
  excerpt: "Learn more about the philosophy and technology behind this digital garden."
5
5
  layout: "simple"
6
+ toc: true
6
7
  ---
7
8
 
8
9
  # About the Garden
@@ -0,0 +1,21 @@
1
+ ---
2
+ title: "关于 Amytis"
3
+ date: "2026-01-07"
4
+ excerpt: "了解这座数字花园背后的理念与技术。"
5
+ layout: "simple"
6
+ ---
7
+
8
+ Amytis 是一座为长期思想培育而设计的数字花园。与博客不同,数字花园是一个持续演化的想法网络。
9
+
10
+ ## 技术栈
11
+
12
+ - **Next.js 15+** — 基础框架
13
+ - **Tailwind CSS v4** — 样式系统
14
+ - **MDX** — 支持 React 组件的富内容格式
15
+ - **Bun** — 极速开发体验
16
+
17
+ ## 理念
18
+
19
+ 我们相信**公开学习**的力量。这里是种下种子(初始笔记)、悉心耕耘(提炼与关联)、最终长成长青文章的地方。
20
+
21
+ > "花园是最好的老师。它教人耐心与细心观察,教人勤劳与节俭,尤其教人全然的信任。" — Gertrude Jekyll
@@ -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]].
@@ -0,0 +1,15 @@
1
+ ---
2
+ tags: ["video", "podcast", "markdown", "web"]
3
+ ---
4
+
5
+ Tested multimedia embedding in Amytis today. Since `rehype-raw` is enabled, standard HTML `<iframe>`, `<video>`, and `<audio>` tags work directly inside Markdown — no plugins needed.
6
+
7
+ A few patterns that work well:
8
+
9
+ - **YouTube / Vimeo** — wrap in a `padding-bottom: 56.25%` container for responsive 16:9
10
+ - **Spotify / Apple Podcasts** — fixed height iframes (152px for compact, 352px for full player)
11
+ - **HTML5 `<video>`** — fully native, supports `poster`, `loop`, `autoplay muted`
12
+ - **HTML5 `<audio>`** — great for podcast episodes or background music samples
13
+ - **Twitch** — needs the `parent` query param set to your domain
14
+
15
+ The `loading="lazy"` attribute is underused — always worth adding to below-the-fold embeds to keep the initial page fast.
@@ -0,0 +1,42 @@
1
+ ---
2
+ title: "Links"
3
+ date: "2026-01-01"
4
+ excerpt: "A curated collection of resources, tools, and friends on the web."
5
+ layout: "simple"
6
+ toc: true
7
+ ---
8
+
9
+ A living collection of places worth visiting — useful resources I return to, and friends whose writing I admire.
10
+
11
+ ---
12
+
13
+ ## Resources
14
+
15
+ ### Writing & Thinking
16
+
17
+ - [Zettelkasten Method](https://zettelkasten.de/) — The definitive guide to networked note-taking and knowledge management.
18
+ - [Andy Matuschak's Notes](https://notes.andymatuschak.org/) — A public working notebook from a researcher in tools for thought.
19
+ - [LessWrong](https://www.lesswrong.com/) — A community blog focused on rationality and careful reasoning.
20
+
21
+ ### Development
22
+
23
+ - [MDN Web Docs](https://developer.mozilla.org/) — The most reliable reference for web platform APIs.
24
+ - [The Changelog](https://changelog.com/) — Podcasts and news for developers following open-source software.
25
+ - [Hacker News](https://news.ycombinator.com/) — Technology news and community discussion curated by Y Combinator.
26
+
27
+ ### Design
28
+
29
+ - [Refactoring UI](https://www.refactoringui.com/) — Practical design advice for developers, by the creators of Tailwind CSS.
30
+ - [Sidebar.io](https://sidebar.io/) — Five design links every day, covering UI, typography, and visual inspiration.
31
+
32
+ ---
33
+
34
+ ## Friends
35
+
36
+ - [Example Blog](https://example.com/) — A thoughtful writer exploring the intersection of technology and everyday life.
37
+ - [Another Garden](https://example.com/) — Beautifully tended digital garden with notes on philosophy and code.
38
+ - [Friend's Site](https://example.com/) — Short-form essays on creativity, craft, and the making of things.
39
+
40
+ ---
41
+
42
+ *Know a link that belongs here? [Send it my way](/about).*
@@ -0,0 +1,41 @@
1
+ ---
2
+ title: "链接"
3
+ date: "2026-01-01"
4
+ excerpt: "精选资源、工具与友情链接。"
5
+ layout: "simple"
6
+ ---
7
+
8
+ 持续更新的精选集合——常常造访的实用资源,以及值得关注的朋友们。
9
+
10
+ ---
11
+
12
+ ## 资源
13
+
14
+ ### 写作与思考
15
+
16
+ - [卡片盒笔记法](https://zettelkasten.de/) — 网络化笔记与知识管理的权威指南。
17
+ - [Andy Matuschak 的笔记](https://notes.andymatuschak.org/) — 思维工具研究者的公开工作笔记本。
18
+ - [LessWrong](https://www.lesswrong.com/) — 专注于理性思维的社区博客。
19
+
20
+ ### 开发
21
+
22
+ - [MDN Web Docs](https://developer.mozilla.org/) — 最可靠的 Web 平台 API 参考文档。
23
+ - [The Changelog](https://changelog.com/) — 面向开发者的开源软件播客与资讯。
24
+ - [Hacker News](https://news.ycombinator.com/) — Y Combinator 精选的技术资讯与社区讨论。
25
+
26
+ ### 设计
27
+
28
+ - [Refactoring UI](https://www.refactoringui.com/) — Tailwind CSS 作者出品的开发者实用设计指南。
29
+ - [Sidebar.io](https://sidebar.io/) — 每日五条设计链接,涵盖 UI、排版与视觉灵感。
30
+
31
+ ---
32
+
33
+ ## 朋友们
34
+
35
+ - [示例博客](https://example.com/) — 探索技术与日常生活交汇点的深度写作者。
36
+ - [另一座花园](https://example.com/) — 关于哲学与代码的精心耕耘的数字花园。
37
+ - [朋友的站点](https://example.com/) — 关于创造、手艺与制作过程的短篇随笔。
38
+
39
+ ---
40
+
41
+ *有好链接想推荐?[告诉我](/about)。*
@@ -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
@@ -0,0 +1,49 @@
1
+ ---
2
+ title: "React Server Components"
3
+ date: "2026-02-10"
4
+ tags: ["react", "nextjs", "architecture"]
5
+ ---
6
+
7
+ React Server Components (RSC) represent the most significant architectural shift in React since hooks. The mental model: components that run only on the server, produce static output, and ship *zero* JavaScript to the client.
8
+
9
+ ## The Key Insight
10
+
11
+ Before RSC, React components were always client-side primitives — even when rendered on the server via SSR, their JavaScript was re-hydrated in the browser. RSC breaks this assumption. A server component:
12
+
13
+ - Can directly `await` database queries, file reads, or API calls
14
+ - Never re-renders on the client (no hydration cost)
15
+ - Can import server-only packages without any client bundle impact
16
+
17
+ ## Composition Model
18
+
19
+ The power is in the *composition*: you can freely mix server and client components in the same tree. A server component can render a client component; a client component can receive server-rendered children as props.
20
+
21
+ ```tsx
22
+ // Server component — runs only on server
23
+ async function ArticlePage({ slug }: { slug: string }) {
24
+ const post = await getPostBySlug(slug); // direct DB/file access
25
+ return (
26
+ <article>
27
+ <h1>{post.title}</h1>
28
+ <LikeButton postId={post.id} /> {/* client component */}
29
+ <MarkdownContent content={post.body} /> {/* server component */}
30
+ </article>
31
+ );
32
+ }
33
+ ```
34
+
35
+ ## The "use client" Boundary
36
+
37
+ `"use client"` marks the boundary where server-rendered output hands off to client-side JavaScript. It doesn't mean "client-only" — server-rendered HTML still crosses the boundary; only interactivity (event handlers, state) requires the client bundle.
38
+
39
+ Common pitfall: passing non-serializable values (like a `Map` or class instance) through the boundary. These can't be serialized to JSON and will cause a runtime error.
40
+
41
+ ## Relation to Hooks
42
+
43
+ RSC doesn't replace React hooks — hooks remain the right tool for client-side state and effects. The shift is that *data fetching* moves to the server, while *interactivity* stays with hooks on the client.
44
+
45
+ The practical result: far less `useEffect` for data loading, simpler components, better performance.
46
+
47
+ ## In Next.js App Router
48
+
49
+ Next.js App Router makes RSC the default. Every component in `app/` is a server component unless it declares `"use client"`. This site's data layer (`src/lib/markdown.ts`) runs exclusively on the server — no API routes needed.
@@ -0,0 +1,45 @@
1
+ ---
2
+ title: "Tailwind CSS v4"
3
+ date: "2026-02-12"
4
+ tags: ["css", "tailwind", "frontend"]
5
+ aliases: ["tailwind-css-v4"]
6
+ ---
7
+
8
+ Tailwind CSS v4 is a complete rewrite of the framework, shifting from a JavaScript-based configuration model to a CSS-first approach. The migration story is smoother than expected, and the performance improvements are significant.
9
+
10
+ ## CSS-First Configuration
11
+
12
+ The biggest change: configuration moves from `tailwind.config.js` into your CSS file using the `@theme` directive.
13
+
14
+ ```css
15
+ @import "tailwindcss";
16
+
17
+ @theme {
18
+ --color-accent: oklch(60% 0.2 250);
19
+ --font-serif: "Georgia", serif;
20
+ --spacing-18: 4.5rem;
21
+ }
22
+ ```
23
+
24
+ This means your design tokens live in CSS — where they belong. You can inspect them in DevTools, use them in arbitrary CSS, and they compose naturally with CSS custom properties.
25
+
26
+ ## The New Engine
27
+
28
+ v4's engine is built in Rust (via Lightning CSS) and is dramatically faster. Cold starts drop from seconds to milliseconds. The dev server no longer needs to scan your content for class names — it intercepts class usage at the PostCSS level.
29
+
30
+ ## Breaking Changes
31
+
32
+ - No more `tailwind.config.js` for most use cases (it still exists for plugins)
33
+ - Default ring width changed from 3px to 1px
34
+ - Standalone opacity utilities removed — use slash syntax instead (e.g., `bg-black/50`)
35
+ - The `!important` modifier moves to the end of the class name (e.g., `shadow-md!` not `!shadow-md`)
36
+ - `@apply` works differently for custom utilities
37
+ - Dark mode config moves to CSS: `@custom-variant dark (&:where(.dark, .dark *))`
38
+
39
+ ## Integration with React Server Components
40
+
41
+ Tailwind v4 pairs well with [[react-server-components|React Server Components]]. Static CSS generation means zero runtime overhead — the right tool for a server-rendered architecture. The class scanning approach would have conflicted with server components anyway (no runtime class generation).
42
+
43
+ ## This Site
44
+
45
+ This garden uses Tailwind v4 with a custom theme defined entirely in `src/app/globals.css`. Theme colors use CSS custom properties so the light/dark toggle works without JavaScript class manipulation.