Implemented a seamless content synchronization workflow from Obsidian vault to documentation site using symbolic links and automated indexing.
ln -s "/Users/<Name>/Library/Mobile Documents/iCloud~md~obsidian/Documents/<Library>" obsidian
Structure:
content/
├── docs/ # Public documentation (tracked in git)
└── obsidian/ # Symlink to Obsidian vault (gitignored)
Created automated extraction script to find and parse markdown files:
#!/bin/bash
extract_title() {
local file="$1"
# Extract title from YAML frontmatter
title=$(sed -n '/^---$/,/^---$/p' "$file" | grep '^title:' | sed 's/^title: *//; s/"//g; s/'"'"'//g')
echo "$title"
}
get_relative_path() {
local file="$1"
# Convert to docs-relative path
echo "$file" | sed 's|.*/content/docs/||' | sed 's|/index.mdx$||'
}
Implemented tabbed interface using Fumadocs components:
File: content/docs/index.mdx
---
title: BearLabs
---
import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
<Tabs items={['Learning', 'Projects', 'Trying']}>
<Tab value="Learning">
| Topic | Title | Link |
|-------|-------|------|
| AIGC | Code | [/learning/aigc/claude/code](/learning/aigc/claude/code) |
...
</Tab>
<Tab value="Projects">
| Category | Title | Link |
|----------|-------|------|
| BearLabs | Data in Supabase | [/projects/bearlabs/data-in-supabase](/projects/bearlabs/data-in-supabase) |
...
</Tab>
<Tab value="Trying">
| Category | Title | Link |
|----------|-------|------|
| Containers | Hyperms | [/trying/containers/hyperms](/trying/containers/hyperms) |
...
</Tab>
</Tabs>
Added summary fallback for failed image loading:
File: src/components/popup/tip.tsx
Features:
summary prop for fallback contentonError eventinterface PopWindowProps {
title: string;
image?: string;
link?: string;
summary?: string; // New prop
}
// Render logic
{image != "" && !imageError ? (
<img onError={() => setImageError(true)} />
) : image != "" && imageError && summary != "" ? (
<div className="p-6 text-gray-300">{summary}</div>
) : (
<iframe src={link} />
)}
Example usage with summary fallback:
<Tip
title="Claude Skills 实战:推荐 5 个高质量 Skills"
link="https://mp.weixin.qq.com/s/..."
image="/docs/learning/aigc/claude/skills/04.png"
summary="这段时间在深入使用 Claude + Skills 的过程中,我逐步形成了一套『可组合、可复用、可自动化』的 Skills 使用体系。"
/>
bearlabs.net/
├── content/
│ ├── docs/ # Public documentation
│ │ ├── index.mdx # Main index with tabs
│ │ ├── learning/ # Learning resources
│ │ ├── projects/ # Project documentation
│ │ └── trying/ # Experimental tools
│ └── obsidian/ # Symlink to Obsidian vault
│ └── Claude/
│ └── Claude Skills/ # Source articles
└── src/
└── components/
└── popup/
└── tip.tsx # Enhanced tip component
Adding New Content:
index.mdx with new entries/public/docs/ pathQuote Handling in MDX:
『』 instead of " in summary text to avoid JSX parsing errorssummary="这是『真实』的内容"