Wiki Linking
Overview
Section titled “Overview”my-buddy uses [[slug]] syntax in markdown body text to create links between entries across collections. A custom remark plugin handles resolution, rendering, and backlink tracking.
Syntax
Section titled “Syntax”Basic Link
Section titled “Basic Link”Met with [[sarah-chen]] about the project.Resolves sarah-chen across all collections by priority order.
Custom Display Text
Section titled “Custom Display Text”Met with [[sarah-chen|Sarah]] about the project.Renders as “Sarah” but links to the sarah-chen entry.
Explicit Collection
Section titled “Explicit Collection”Check [[contacts/sarah-chen]] for details.Targets a specific collection instead of auto-resolving.
Explicit Collection + Custom Text
Section titled “Explicit Collection + Custom Text”Check [[contacts/sarah-chen|Sarah's profile]] for details.Resolution Priority
Section titled “Resolution Priority”When using [[slug]] without a collection prefix, the plugin resolves in this order:
- Accounts
- Contacts
- Projects
- Deals
- Tasks
- KB
- Meetings
- Journals
How It Works
Section titled “How It Works”Build-Time Index
Section titled “Build-Time Index”The pre-build step (bun build:index) generates two JSON files:
src/data/wiki-link-index.json— Maps every slug to its collection and URLsrc/data/backlink-index.json— Maps every entry to the entries that reference it
Remark Plugin
Section titled “Remark Plugin”The remark plugin (src/plugins/wiki-links/) transforms wiki link syntax during the Astro build:
[[slug]]→<a class="wiki-link" href="/collection/slug">Display Name</a>- Broken links →
<span class="wiki-link-broken">slug</span>
Backlinks
Section titled “Backlinks”Each entry’s detail page shows a “Referenced by” section listing all entries that link to it. This is powered by the backlink index generated at build time.
Examples
Section titled “Examples”## Meeting Notes
Discussed [[acme-crm-integration]] timeline with [[sarah-chen]].She mentioned the [[api-rate-limiting|rate limiting article]] in our KBmight need updating before we proceed.
Action items:- Update [[kb/api-rate-limiting]] with new limits- Create task for [[acme-corp]] API review