@hutusi/amytis 1.7.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.
- package/CHANGELOG.md +49 -0
- package/GEMINI.md +6 -0
- package/README.md +14 -0
- package/TODO.md +15 -3
- package/bun.lock +5 -3
- package/content/flows/2026/02/05.md +0 -1
- package/content/flows/2026/02/10.mdx +2 -1
- package/content/flows/2026/02/15.md +2 -1
- package/content/flows/2026/02/18.mdx +2 -1
- package/content/flows/2026/02/20.md +0 -1
- package/content/notes/algorithms-and-data-structures.mdx +51 -0
- package/content/notes/digital-garden-philosophy.mdx +36 -0
- package/content/notes/react-server-components.mdx +49 -0
- package/content/notes/tailwind-v4.mdx +45 -0
- package/content/notes/zettelkasten-method.mdx +33 -0
- package/docs/ARCHITECTURE.md +8 -0
- package/docs/CONTRIBUTING.md +11 -0
- package/docs/DIGITAL_GARDEN.md +64 -0
- package/package.json +7 -3
- package/scripts/generate-knowledge-graph.ts +162 -0
- package/scripts/new-flow.ts +0 -5
- package/scripts/new-note.ts +53 -0
- package/site.config.ts +21 -1
- package/src/app/flows/[year]/[month]/[day]/page.tsx +32 -29
- package/src/app/flows/[year]/[month]/page.tsx +15 -13
- package/src/app/flows/[year]/page.tsx +22 -15
- package/src/app/flows/page/[page]/page.tsx +3 -9
- package/src/app/flows/page.tsx +3 -8
- package/src/app/globals.css +41 -0
- package/src/app/graph/page.tsx +19 -0
- package/src/app/notes/[slug]/page.tsx +128 -0
- package/src/app/notes/page/[page]/page.tsx +58 -0
- package/src/app/notes/page.tsx +31 -0
- package/src/app/page.tsx +0 -1
- package/src/app/posts/[slug]/page.tsx +4 -2
- package/src/app/search.json/route.ts +15 -1
- package/src/components/Backlinks.tsx +39 -0
- package/src/components/FlowCalendarSidebar.tsx +4 -2
- package/src/components/FlowContent.tsx +4 -3
- package/src/components/FlowHubTabs.tsx +50 -0
- package/src/components/FlowTimelineEntry.tsx +7 -9
- package/src/components/KnowledgeGraph.tsx +324 -0
- package/src/components/MarkdownRenderer.tsx +13 -2
- package/src/components/Navbar.tsx +235 -9
- package/src/components/NoteContent.tsx +123 -0
- package/src/components/NoteSidebar.tsx +132 -0
- package/src/components/RecentNotesSection.tsx +6 -11
- package/src/components/Search.tsx +5 -1
- package/src/components/TagContentTabs.tsx +0 -1
- package/src/i18n/translations.ts +21 -1
- package/src/layouts/PostLayout.tsx +8 -3
- package/src/lib/markdown.ts +276 -3
- package/src/lib/remark-wikilinks.ts +59 -0
- package/src/lib/search-utils.ts +2 -1
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
|
@@ -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).
|
|
@@ -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
|
@@ -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
|
-
- [ ] **
|
|
11
|
-
- [ ]
|
|
12
|
-
- [ ]
|
|
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@
|
|
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=="],
|
|
@@ -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,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.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Zettelkasten Method"
|
|
3
|
+
date: "2026-02-01"
|
|
4
|
+
tags: ["zettelkasten", "note-taking", "knowledge-management"]
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The Zettelkasten ("slip-box") method is a personal knowledge management system developed by sociologist Niklas Luhmann. He produced over 90 books and hundreds of articles, crediting much of his productivity to this system.
|
|
8
|
+
|
|
9
|
+
## Core Principles
|
|
10
|
+
|
|
11
|
+
**Atomic notes** — each note captures exactly one idea. If you need to say two things, write two notes. This constraint forces clarity and creates more connection points.
|
|
12
|
+
|
|
13
|
+
**Linking over filing** — instead of organizing notes into folders or categories, you link them to related ideas. The structure that emerges is a network, not a tree.
|
|
14
|
+
|
|
15
|
+
**Your own words** — always paraphrase rather than copy. The act of rewriting forces understanding and makes the note genuinely yours.
|
|
16
|
+
|
|
17
|
+
**Permanent notes** — unlike fleeting notes (quick captures) or literature notes (summaries of sources), permanent notes are written to last. They connect to existing knowledge and stand alone without context.
|
|
18
|
+
|
|
19
|
+
## Why It Works
|
|
20
|
+
|
|
21
|
+
A folder system forces you to predict how you'll want to retrieve something. Linking lets you discover connections you didn't anticipate. Luhmann described his Zettelkasten as a "conversation partner" — it would surprise him with unexpected connections between distant ideas.
|
|
22
|
+
|
|
23
|
+
The compounding effect is real: the more notes you have, the more connections are possible, and the more generative each new note becomes.
|
|
24
|
+
|
|
25
|
+
## Relation to Digital Gardens
|
|
26
|
+
|
|
27
|
+
[[digital-garden-philosophy]] takes the Zettelkasten spirit and applies it to public publishing. Where Luhmann's slip-box was private, a digital garden invites readers into the thinking process — with all its incompleteness and revision.
|
|
28
|
+
|
|
29
|
+
## In This Garden
|
|
30
|
+
|
|
31
|
+
This site implements Zettelkasten-style notes with bi-directional links. Any `[[wikilink]]` you write creates a connection that shows up in the backlinks panel of the target note.
|
|
32
|
+
|
|
33
|
+
See the [[digital-garden-philosophy]] note for how this fits the broader philosophy of this garden.
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -40,6 +40,11 @@ src/app/
|
|
|
40
40
|
page.tsx # All books overview
|
|
41
41
|
[slug]/page.tsx # Book landing page
|
|
42
42
|
[slug]/[chapter]/page.tsx # Individual book chapter
|
|
43
|
+
notes/
|
|
44
|
+
page.tsx # All notes list
|
|
45
|
+
[slug]/page.tsx # Individual note
|
|
46
|
+
graph/
|
|
47
|
+
page.tsx # Knowledge graph visualization
|
|
43
48
|
flows/
|
|
44
49
|
page.tsx # Flows stream/listing
|
|
45
50
|
[year]/[month]/[day]/page.tsx # Individual flow entry (optional if modal/stream used)
|
|
@@ -96,6 +101,9 @@ src/app/
|
|
|
96
101
|
| `getAllBooks()` | `BookData[]` | All books metadata |
|
|
97
102
|
| `getBookData(slug)` | `BookData \| null` | Single book metadata & TOC |
|
|
98
103
|
| `getBookChapter(...)` | `BookChapterData` | Single chapter content |
|
|
104
|
+
| `getAllNotes()` | `NoteData[]` | All notes, sorted by date |
|
|
105
|
+
| `getNoteBySlug(slug)` | `NoteData \| null` | Single note content |
|
|
106
|
+
| `getBacklinks(slug)` | `BacklinkSource[]` | Inbound links for a page |
|
|
99
107
|
| `getFlowBySlug(slug)` | `FlowData \| null` | Single flow entry |
|
|
100
108
|
| `getSeriesPosts(slug)` | `PostData[]` | Posts in a series |
|
|
101
109
|
| `calculateReadingTime(content)` | `string` | Estimated reading time (multilingual) |
|
package/docs/CONTRIBUTING.md
CHANGED
|
@@ -55,6 +55,17 @@ Books are manually structured in `content/books/`.
|
|
|
55
55
|
2. Add `index.mdx` with metadata and chapters configuration.
|
|
56
56
|
3. Create the chapter files (`welcome.mdx`, `conclusion.mdx`) in the same folder.
|
|
57
57
|
|
|
58
|
+
### Creating Notes (Digital Garden)
|
|
59
|
+
|
|
60
|
+
Notes live in `content/notes/`.
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Create a new note
|
|
64
|
+
bun run new "Zettelkasten Method" --note
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Or manually create `content/notes/zettelkasten-method.mdx`.
|
|
68
|
+
|
|
58
69
|
### Importing Content
|
|
59
70
|
|
|
60
71
|
```bash
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Digital Garden Features
|
|
2
|
+
|
|
3
|
+
Amytis includes a suite of features designed for non-linear knowledge management, inspired by the "Digital Garden" philosophy. These features allow you to create an interconnected web of thoughts rather than just a linear stream of posts.
|
|
4
|
+
|
|
5
|
+
## Core Concepts
|
|
6
|
+
|
|
7
|
+
### 1. Notes (`/notes`)
|
|
8
|
+
Notes are atomic units of knowledge. Unlike posts, which are often time-bound articles, notes are evergreen and concept-oriented.
|
|
9
|
+
|
|
10
|
+
- **Location:** `content/notes/*.mdx`
|
|
11
|
+
- **Frontmatter:**
|
|
12
|
+
```yaml
|
|
13
|
+
---
|
|
14
|
+
title: "Zettelkasten Method"
|
|
15
|
+
tags: ["pkm", "productivity"]
|
|
16
|
+
aliases: ["zettelkasten", "slip-box"] # Alternative names for wiki-linking
|
|
17
|
+
backlinks: true # Show backlinks at the bottom (default: true)
|
|
18
|
+
---
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### 2. Wiki-links
|
|
22
|
+
You can link between any content (Posts, Notes, Flows) using double-bracket syntax: `[[Slug]]` or `[[Slug|Display Text]]`.
|
|
23
|
+
|
|
24
|
+
- **Standard Link:** `[[zettelkasten-method]]` → links to `/notes/zettelkasten-method`
|
|
25
|
+
- **Aliased Link:** `[[zettelkasten-method|The Slip Box]]` → links to same note but displays "The Slip Box"
|
|
26
|
+
- **Cross-Type Linking:**
|
|
27
|
+
- If a slug matches a Note, it links to `/notes/[slug]`
|
|
28
|
+
- If it matches a Post, it links to `/posts/[slug]`
|
|
29
|
+
- If it matches a Flow, it links to `/flows/[slug]`
|
|
30
|
+
|
|
31
|
+
### 3. Backlinks
|
|
32
|
+
At the bottom of every Note, Amytis automatically generates a "Linked References" section. This lists every other page that links *to* the current note, along with a context snippet showing how it was referenced.
|
|
33
|
+
|
|
34
|
+
### 4. Knowledge Graph
|
|
35
|
+
The `/graph` route visualizes your entire digital garden as an interactive network graph.
|
|
36
|
+
- **Nodes**: Represent Notes, Posts, and Flows.
|
|
37
|
+
- **Edges**: Represent wiki-links connecting them.
|
|
38
|
+
- **Interaction**: Click a node to navigate to that page.
|
|
39
|
+
|
|
40
|
+
## How to Use
|
|
41
|
+
|
|
42
|
+
1. **Create a Note**: Run `bun new "My Concept" --note` (or manually create `content/notes/my-concept.mdx`).
|
|
43
|
+
2. **Link to it**: In a blog post or another note, type `[[my-concept]]`.
|
|
44
|
+
3. **Explore**: Visit `/notes` to see your collection, or `/graph` to see the connections.
|
|
45
|
+
|
|
46
|
+
## Configuration
|
|
47
|
+
|
|
48
|
+
In `site.config.ts`, you can configure the graph visualization:
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
export const siteConfig = {
|
|
52
|
+
// ...
|
|
53
|
+
features: {
|
|
54
|
+
graph: {
|
|
55
|
+
enabled: true,
|
|
56
|
+
name: { en: "Graph", zh: "知识图谱" },
|
|
57
|
+
},
|
|
58
|
+
notes: {
|
|
59
|
+
enabled: true,
|
|
60
|
+
name: { en: "Notes", zh: "笔记" },
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hutusi/amytis",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "A high-performance digital garden and blog engine with Next.js 16 and Tailwind CSS v4",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,8 +14,9 @@
|
|
|
14
14
|
"packageManager": "bun@1.3.4",
|
|
15
15
|
"scripts": {
|
|
16
16
|
"dev": "next dev",
|
|
17
|
-
"build": "bun scripts/copy-assets.ts && next build && next-image-export-optimizer && pagefind --site out",
|
|
18
|
-
"build:dev": "bun scripts/copy-assets.ts && next build && pagefind --site out --output-path public/pagefind",
|
|
17
|
+
"build": "bun scripts/copy-assets.ts && bun run build:graph && next build && next-image-export-optimizer && pagefind --site out",
|
|
18
|
+
"build:dev": "bun scripts/copy-assets.ts && bun run build:graph && next build && pagefind --site out --output-path public/pagefind",
|
|
19
|
+
"build:graph": "NODE_ENV=production bun scripts/generate-knowledge-graph.ts",
|
|
19
20
|
"validate": "bun run lint && bun run test && bun run build:dev",
|
|
20
21
|
"clean": "rm -rf .next out public/posts public/books public/flows",
|
|
21
22
|
"new": "bun scripts/new-post.ts",
|
|
@@ -24,6 +25,7 @@
|
|
|
24
25
|
"new-from-pdf": "bun scripts/new-from-pdf.ts",
|
|
25
26
|
"new-from-images": "bun scripts/new-from-images.ts",
|
|
26
27
|
"new-flow": "bun scripts/new-flow.ts",
|
|
28
|
+
"new-note": "bun scripts/new-note.ts",
|
|
27
29
|
"series-draft": "bun scripts/series-draft.ts",
|
|
28
30
|
"start": "next start",
|
|
29
31
|
"lint": "eslint",
|
|
@@ -35,6 +37,7 @@
|
|
|
35
37
|
"dependencies": {
|
|
36
38
|
"@giscus/react": "^3.1.0",
|
|
37
39
|
"@tailwindcss/typography": "^0.5.19",
|
|
40
|
+
"d3": "^7.9.0",
|
|
38
41
|
"github-slugger": "^2.0.0",
|
|
39
42
|
"gray-matter": "^4.0.3",
|
|
40
43
|
"image-size": "^2.0.2",
|
|
@@ -58,6 +61,7 @@
|
|
|
58
61
|
"devDependencies": {
|
|
59
62
|
"@tailwindcss/postcss": "^4.1.18",
|
|
60
63
|
"@types/bun": "^1.3.9",
|
|
64
|
+
"@types/d3": "^7.4.3",
|
|
61
65
|
"@types/image-size": "^0.8.0",
|
|
62
66
|
"@types/node": "^24.10.13",
|
|
63
67
|
"@types/react": "^19.2.14",
|