feat(daily): add daily note creation workflow and documentation

Add comprehensive daily note system with multiple creation methods:

- Add daily-note.js script for CLI-based daily note creation
- Add daily-note npm command to package.json
- Create DAILY_NOTE_GUIDE.md with complete workflow documentation
  - Three creation methods: CLI, Templater, QuickAdd
  - Step-by-step usage instructions
  - Recommended daily workflows
  - Troubleshooting guide

Add new reference documentation:
- GIT_WORKFLOW.md: Git workflow best practices
- PARA_METHOD.md: PARA method explanation
- TROUBLESHOOTING.md: Extended troubleshooting guide
- AGENTS.md: Agent coding guidelines and commands
- QUICK_REFERENCE.md: 1-page quick reference card
- REFACTOR_SUMMARY.md: Refactoring summary

Organize reference docs:
- Move Templater guides to 06_Metadata/Reference/
- Move Obsidian plugins manual to 06_Metadata/Reference/
This commit is contained in:
windyboy
2026-01-06 14:16:07 +08:00
parent 09e19cecfd
commit f44f8b8e6a
13 changed files with 2969 additions and 11 deletions
+445
View File
@@ -0,0 +1,445 @@
---
created: 2026-01-06
type: reference
tags: [reference, daily-workflow, tutorial]
---
# 每日日记完整指南
**快速创建每日笔记的三种方式**
---
## 📋 方式一:命令行创建(最快)
### 基础用法
```bash
# 创建今日普通日记(文件名:YYYY-MM-DD.md
pnpm daily-note
# 创建带主题的日记(文件名:YYYY-MM-DD - 主题.md
pnpm daily-note "学习 Claude Code"
pnpm daily-note "项目会议"
pnpm daily-note "阅读笔记"
```
### 适用场景
- ✅ 习惯使用命令行
- ✅ 需要快速捕获想法
- ✅ 在终端工作
- ✅ 配合 Git 提交流程
### 示例
```bash
# 早上启动时
git pull
pnpm daily-note "今日工作计划"
# 编辑文件,开始工作...
# 晚上结束时
pnpm daily-note "今日总结"
# 编辑文件,总结当天
git add .
git commit -m "daily: $(date +%Y-%m-%d)"
git push
```
---
## 📱 方式二:Obsidian 插件(图形界面)
### Templater 插件 - 自动模板应用
**配置位置**`.obsidian/plugins/templater-obsidian/data.json`
当前配置已启用:
- 模板文件夹:`06_Metadata/Templates`
-`00_Inbox/` 创建文件时,自动应用 `Daily Note Template.md`
-`01_Projects/` 创建文件时,自动应用 `Project Template.md`
#### 使用步骤
1. **打开 Obsidian**
2. **导航到 `00_Inbox/` 文件夹**
3. **点击"创建笔记"图标**(或快捷键 `Ctrl+N`
4. **输入文件名**(建议格式:`YYYY-MM-DD - 主题`
5. **按 Enter 创建**
6. **Templater 自动填充模板**
#### 模板对比
**英文模板**(自动应用):
```
# 2026-01-06
## Capture
-
## Questions
-
## Insights
-
## Connections
-
## For Tomorrow
-
```
**中文模板**(手动应用):
```
---
date: 2026-01-06
day: Monday
week: 2026-W02
type: daily-note
---
# 2026年01月06日 星期一
## 📋 今日任务
- [ ]
## 📝 工作笔记
## 💡 想法与灵感
## 📚 学习记录
## 🎯 重点事项
## 📊 总结
---
← [[2026-01-05]] | [[2026-01-07]] →
```
#### 手动应用模板
如果不想使用自动模板,可以:
1. **快捷键 `Ctrl+E`**(打开 Templater 命令面板)
2. **选择模板**
- `daily-note.md`(中文版本,带日期链接)
- `Daily Note Template.md`(英文简单版)
3. **模板插入到当前文件**
#### 创建快捷键
**在 Obsidian 设置中**
1. `设置``快捷键` → 搜索 "Templater"
2. 找到 "Open Insert Template modal"
3. 设置快捷键(例如:`Ctrl+Shift+T`
### QuickAdd 插件 - 高级自动化
**当前配置**:QuickAdd 已安装但未配置任何 Choice(需要手动设置)
#### 配置 QuickAdd 创建日记
**步骤 1:在 Obsidian 中打开 QuickAdd 设置**
- `设置``社区插件``QuickAdd``Manage`
**步骤 2:创建新 Choice**
- 点击 `+ Create Choice`
- 名称:`Daily Note`
- 类型:`Template`
**步骤 3:配置 Template 选项**
- **Template Path**: `06_Metadata/Templates/daily-note.md`
- **File Name Format**: `{{DATE:YYYY-MM-DD}}`
- **File Location**: `00_Inbox`
- **Open**: `Create new tab`
**步骤 4:添加变量(可选)**
在 Template 中使用 QuickAdd 变量:
```markdown
# {{DATE:YYYY年MM月DD日 dddd}}
## 📋 今日任务
- [ ] {{VALUE:今天的主要任务?}}
```
**步骤 5:设置快捷键**
- 在设置中找到 "Daily Note" choice
- 设置快捷键(例如:`Ctrl+Shift+D`
#### 使用 QuickAdd 创建日记
配置完成后,按快捷键 `Ctrl+Shift+D` 即可:
- ✅ 自动创建日记
- ✅ 自动命名(带日期)
- ✅ 自动保存到指定文件夹
- ✅ 应用模板
- ✅ 可选择输入变量值
---
## 🤖 方式三:Claude Code 智能命令
### /daily-review 命令
**功能**:每日结束时的智能回顾,自动分析当天活动
**使用方法**
```bash
# 在 Claude Code 中
/daily-review
```
**命令会自动**
1. 🔍 查找今天修改/创建的所有笔记
2. 📊 分析项目进度
3. 💡 提取关键见解
4. 🔗 发现笔记之间的连接
5. 📝 生成每日总结
6. 🎯 设定明天的优先级
**输出格式**(更新到每日笔记):
```markdown
## Accomplished
- ✓ [Completed item 1]
- ✓ [Completed item 2]
## Progress Made
- [Project]: [What moved forward]
## Insights
- [Key realization]
## Discovered Questions
- [New question]
## Tomorrow's Focus
1. [Priority 1]
2. [Priority 2]
3. [Priority 3]
```
---
## 🔄 工作流推荐
### 每日例行流程
#### ☀️ 早晨(启动工作)
**命令行工作流**
```bash
# 1. 同步代码
git pull
# 2. 创建今日日记
pnpm daily-note "今日工作"
# 3. 在编辑器中打开文件
# 添加今日计划和任务
```
**Obsidian 工作流**
```bash
# 1. 打开 Obsidian
# 2. 按 Ctrl+Shift+DQuickAdd
# 3. 输入今日主题
# 4. 开始记录
```
#### 🌞 白天(工作过程)
**快速捕获**
- 命令行:`pnpm daily-note "快速想法"`
- Obsidian`00_Inbox/` 中创建临时笔记
- Claude Code`/thinking-partner` 记录对话
**关联笔记**
- 使用 `[[链接]]` 引用相关项目、资源
- 标记重要发现到每日笔记
#### 🌙 晚上(结束工作)
**Claude Code 回顾**
```bash
# 1. 运行每日回顾
/daily-review
# 2. 审查生成的总结
# 3. 补充遗漏的内容
# 4. 提交到 Git
git add .
git commit -m "daily: $(date +%Y-%m-%d)"
git push
```
**Obsidian 整理**
1. 检查 `00_Inbox/` 内容
2. 移动笔记到正确的 PARA 位置
3. 更新项目状态
4. 链接相关笔记
---
## 📊 对比三种方式
| 特性 | 命令行 | Obsidian Templater | QuickAdd |
|------|--------|-------------------|----------|
| **速度** | ⚡ 最快 | 🚀 快 | ⚡ 快(配置后) |
| **配置** | ✅ 无需配置 | ✅ 预配置 | ⚠️ 需手动配置 |
| **灵活性** | ⚠️ 基础 | 🚀 高 | 🌟 极高 |
| **自动化** | ⚠️ 有限 | 🚀 自动应用 | 🌟 高度自动化 |
| **图形界面** | ❌ 无 | ✅ 有 | ✅ 有 |
| **变量支持** | ❌ 无 | ✅ Templater 语法 | ✅ QuickAdd 语法 |
| **适用场景** | 命令行爱好者 | Obsidian 用户 | 高级用户 |
---
## 🎯 推荐组合
### 初学者
- **主要方式**Obsidian Templater(自动模板)
- **辅助方式**:命令行 `pnpm daily-note`
### 进阶用户
- **主要方式**QuickAdd(快捷键 `Ctrl+Shift+D`
- **辅助方式**Claude Code `/daily-review`
### 高级用户
- **早晨**QuickAdd 创建日记
- **白天**:命令行快速捕获
- **晚上**Claude Code 智能回顾
- **整理**Obsidian 图形界面链接
---
## 💡 技巧与最佳实践
### 1. 命名规范
**推荐格式**
```
YYYY-MM-DD # 纯日期,普通日记
YYYY-MM-DD - [主题] # 带主题,特定活动
Meeting - [主题] - [日期] # 会议记录
Idea - [简短描述] # 想法记录
```
### 2. 模板自定义
**在 `06_Metadata/Templates/` 中创建自定义模板**
```markdown
# {{date:YYYY-MM-DD}}
## 🎯 今日目标
- [ ]
## 📈 进度跟踪
## 🔍 问题与挑战
## 💡 学到的东西
## 📝 待跟进
```
### 3. 日期链接
**中文模板支持前一天/后一天链接**
```markdown
---
← [[2026-01-05]] | [[2026-01-07]] →
---
```
在 Obsidian 中点击日期即可跳转
### 4. Git 提交钩子(可选)
**自动化每日提交**(在 `.git/hooks/post-commit`):
```bash
#!/bin/bash
# 自动提交到远程
git push
```
### 5. 每日提醒
**使用 Obsidian Calendar 插件**
- 安装 Calendar 插件(已安装)
- 设置每日提醒创建日记
- 可视化查看日记历史
---
## 🔧 故障排除
### 命令行方式失败
**问题**`pnpm daily-note` 报错
```
'pnpm' is not recognized
```
**解决**
```bash
# 安装 pnpm
npm install -g pnpm
# 或使用 npm
npm run daily-note
```
### Templater 模板不应用
**问题**:在 `00_Inbox/` 创建文件,模板未自动填充
**检查**
1. Templater 插件是否启用
2. `trigger_on_file_creation` 是否为 `true`
3. 文件夹模板配置是否正确
4. 模板文件是否存在
### QuickAdd 无响应
**问题**:按快捷键没有反应
**解决**
1. 检查快捷键是否被其他插件占用
2. 重新加载 Obsidian(禁用后启用 QuickAdd
3. 查看 Console 日志(`Ctrl+Shift+I`
---
## 📚 相关文档
- [[QUICK_REFERENCE]] - 快速参考卡片
- [[WEEKLY_REVIEW]] - 每周回顾流程
- [[AGENTS]] - Claude Code 命令说明
- [[README]] - 项目完整文档
---
## 🆘 需要帮助?
**获取即时帮助**
```bash
# 在 Claude Code 中询问
"如何自定义每日日记模板?"
"如何设置 QuickAdd 自动创建日记?"
"如何将日记链接到项目?"
```
---
**最后更新**2026-01-06
**作者**Claude Code Assistant
**版本**1.0
+538
View File
@@ -0,0 +1,538 @@
---
created: 2026-01-06
type: reference
tags: [git, workflow, version-control]
---
# Git Workflow Guide
Complete guide to Git version control for your Obsidian vault.
---
## Critical Rule
**ALWAYS start sessions with `git pull`** to sync latest changes from remote repository.
This prevents conflicts and ensures you're working with the latest version.
---
## Daily Workflow
### Morning (Session Start)
```bash
cd D:\tmp\vault\my-vault
git pull
git status # Check for any conflicts
```
**What this does**:
- Changes to vault directory
- Pulls latest changes from remote
- Shows current status (conflicts, uncommitted changes)
### During Work
```bash
git status # Periodically check changes
```
**Optional**: Check what's been modified while working.
### Evening (Session End)
```bash
git status # Review all changes
git add . # Stage all changes
git commit -m "vault backup: $(date +%Y-%m-%d\ %H:%M:%S)"
git push # Sync to remote
```
**What this does**:
- Shows all modified/new/deleted files
- Stages everything for commit
- Creates commit with timestamp
- Pushes to remote repository
---
## Commit Message Guidelines
### Format
```
[type]: [brief description]
Examples:
vault backup: 2026-01-06 20:30:15
Add: Project planning notes for Q1 initiatives
Update: Weekly review template with new sections
Organize: Moved inbox items to appropriate folders
Archive: Completed research project
```
### Common Types
| Type | When to Use | Example |
|------|-------------|---------|
| `vault backup:` | Regular daily backup | `vault backup: 2026-01-06 20:00` |
| `Add:` | New notes/projects | `Add: Machine learning project notes` |
| `Update:` | Modify existing content | `Update: CLAUDE.md with new workflow` |
| `Organize:` | File movements | `Organize: Processed inbox items` |
| `Archive:` | Moving to archive | `Archive: Completed Q4 projects` |
| `Fix:` | Bug fixes, broken links | `Fix: Broken attachment links` |
### When to Commit
- ✅ After organizing inbox
- ✅ After creating new notes
- ✅ After significant edits
- ✅ Before ending session
- ✅ After weekly review
- ✅ After major reorganization
**Don't**: Commit every single edit. Batch related changes together.
---
## Common Git Commands
### Essential Commands
```bash
git status # Check current state
git pull # Sync from remote
git add . # Stage all changes
git commit -m "message" # Commit with message
git push # Sync to remote
git log --oneline -10 # View recent commits
```
### Useful Commands
```bash
# View what changed in a file
git diff filename.md
# View all recent changes
git diff
# View commit history
git log --oneline
# View changes in last commit
git show
# Unstage a file (before commit)
git restore --staged filename.md
# Discard changes to a file (DANGER)
git restore filename.md
```
### File History
```bash
# Find when a file was deleted/moved
git log --all --full-history -- path/to/file.md
# View all commits that touched a file
git log --follow -- path/to/file.md
# See file contents from specific commit
git show <commit-hash>:path/to/file.md
```
---
## Handling Conflicts
### When Conflicts Happen
**Scenario**: You run `git pull` and see:
```
CONFLICT (content): Merge conflict in filename.md
Automatic merge failed; fix conflicts and then commit the result.
```
### Resolution Steps
**1. Open conflicted file**
You'll see markers like this:
```markdown
Normal content here...
<<<<<<< HEAD
Your local changes
=======
Remote changes from other device
>>>>>>> origin/main
More normal content...
```
**2. Resolve manually**
Choose which version to keep (or combine both):
```markdown
Normal content here...
Combined changes (best of both versions)
More normal content...
```
Delete conflict markers (`<<<<<<<`, `=======`, `>>>>>>>`).
**3. Stage and commit**
```bash
git add .
git commit -m "Resolve merge conflicts"
git push
```
### Preventing Conflicts
**Best Practices**:
1. ✅ Always `git pull` before starting work
2. ✅ Commit and push at end of each session
3. ✅ Don't edit same file on multiple devices simultaneously
4. ✅ Use descriptive commit messages to track changes
**If working on multiple devices**:
- Device A: Edit → Commit → Push
- Device B: Pull → Edit → Commit → Push
- Device A: Pull (gets Device B's changes)
---
## Advanced Workflows
### Checking Changes Before Commit
```bash
# See what will be committed
git status
# See detailed changes
git diff
# Review changes file by file
git diff filename.md
```
### Selective Staging
```bash
# Stage specific files only
git add path/to/file1.md path/to/file2.md
# Stage all markdown files
git add "*.md"
# Stage entire folder
git add 01_Projects/
```
### Commit History
```bash
# Last 10 commits (one line each)
git log --oneline -10
# Detailed view
git log -5
# With file changes
git log --stat -5
# Search commits by message
git log --grep="inbox"
# Commits from last week
git log --since="1 week ago"
```
### Undoing Changes
**Before Commit (Unstage)**:
```bash
# Unstage specific file
git restore --staged filename.md
# Unstage everything
git restore --staged .
```
**Discard Local Changes** (⚠️ DANGER - Cannot undo):
```bash
# Discard changes to specific file
git restore filename.md
# Discard ALL local changes
git restore .
```
**After Commit (Advanced)**:
```bash
# Undo last commit (keep changes)
git reset --soft HEAD~1
# Undo last commit (discard changes) - DANGER
git reset --hard HEAD~1
```
⚠️ **Warning**: Only use `reset --hard` if you're certain. Changes are lost permanently.
---
## .gitignore
### What to Ignore
Your `.gitignore` file should exclude:
```gitignore
# Obsidian workspace (device-specific)
.obsidian/workspace.json
.obsidian/workspace-mobile.json
# System files
.DS_Store
Thumbs.db
desktop.ini
# Temporary files
*.tmp
~$*.md
# Sensitive files (if any)
.env
secrets/
```
### What to Commit
**Do commit**:
- `.obsidian/` (most config)
- All markdown files (`.md`)
- Attachments in `05_Attachments/`
- Templates, scripts, documentation
**Don't commit**:
- Workspace files (device-specific layout)
- System files (`.DS_Store`)
- Large binary files (videos) - use Git LFS
- Sensitive information (API keys, passwords)
---
## Troubleshooting
### "Repository not found"
**Problem**: Can't push/pull from remote
**Solution**:
```bash
# Check remote URL
git remote -v
# Fix remote URL if needed
git remote set-url origin <correct-url>
```
### "Your branch is ahead by N commits"
**Meaning**: You have local commits not pushed to remote
**Solution**:
```bash
git push
```
### "Your branch is behind by N commits"
**Meaning**: Remote has commits you don't have locally
**Solution**:
```bash
git pull
```
### "Diverged branches"
**Meaning**: You and remote both have different commits
**Solution**:
```bash
git pull # May auto-merge
# If conflicts, resolve manually
git add .
git commit -m "Resolve merge conflicts"
git push
```
### "Permission denied (publickey)"
**Problem**: SSH key not configured
**Solutions**:
1. **Use HTTPS instead of SSH**:
```bash
git remote set-url origin https://github.com/username/repo.git
```
2. **Or configure SSH key**:
- Generate: `ssh-keygen -t ed25519 -C "your_email@example.com"`
- Add to GitHub: Settings → SSH Keys → Add Key
### Accidentally Committed Sensitive File
**Immediate Action**:
```bash
# Remove from Git (keep local file)
git rm --cached sensitive-file.txt
# Add to .gitignore
echo "sensitive-file.txt" >> .gitignore
# Commit removal
git add .gitignore
git commit -m "Remove sensitive file from tracking"
git push
```
**⚠️ Note**: File still exists in Git history. For complete removal, use `git filter-branch` or BFG Repo-Cleaner (advanced).
---
## Best Practices
### DO ✅
- **Pull before starting work** (every session)
- **Commit frequently** (daily minimum)
- **Use descriptive messages** (understand changes later)
- **Push at end of session** (backup to remote)
- **Review `git status`** before committing
- **Keep commits atomic** (one logical change per commit)
### DON'T ❌
- **Never force push** to main/master (`git push --force`)
- **Don't commit secrets** (API keys, passwords)
- **Don't commit huge files** (videos > 50MB - use Git LFS)
- **Don't edit history** of pushed commits (causes conflicts)
- **Don't ignore conflicts** (resolve immediately)
---
## Multi-Device Workflow
### Device A (Desktop)
```bash
# Morning
git pull
# Work throughout day...
# Evening
git add .
git commit -m "vault backup: $(date)"
git push
```
### Device B (Laptop)
```bash
# Later that evening
git pull # Gets Desktop's changes
# Work on laptop...
# Before sleep
git add .
git commit -m "vault backup: $(date)"
git push
```
### Device A (Next Day)
```bash
# Next morning
git pull # Gets Laptop's changes
# Continue working...
```
**Key**: Always pull before starting, push when done.
---
## Quick Reference
### Most Used Commands
```bash
# Daily workflow
git pull # Start of session
git status # Check changes
git add . # Stage all
git commit -m "vault backup: $(date)" # Commit
git push # End of session
# Viewing history
git log --oneline -10 # Recent commits
git diff # See changes
# Fixing issues
git restore --staged . # Unstage
git restore filename.md # Discard changes
```
### Emergency Commands
```bash
# Conflicts during pull
git status # See conflicted files
# Edit files manually
git add .
git commit -m "Resolve conflicts"
git push
# Undo last commit (keep changes)
git reset --soft HEAD~1
# Completely reset to remote (DANGER - loses local changes)
git fetch origin
git reset --hard origin/main
```
---
## Further Reading
**Official Git Documentation**: https://git-scm.com/doc
**Recommended Learning**:
- Git basics: https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control
- Branching (advanced): https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging
**Visual Git Tools**:
- GitKraken (GUI client)
- GitHub Desktop (simple interface)
- VS Code built-in Git (integrated)
---
**Last Updated**: 2026-01-06
**See Also**: [[CLAUDE]], [[QUICK_REFERENCE]], [[TROUBLESHOOTING]]
File diff suppressed because it is too large Load Diff
+400
View File
@@ -0,0 +1,400 @@
---
created: 2026-01-06
type: reference
tags: [para, methodology, organization]
---
# PARA Method Explained
**P.A.R.A.** = Projects, Areas, Resources, Archive
A universal system for organizing digital information based on **actionability**.
---
## Core Principle
**Organize by actionability, not by category**
Traditional filing (by topic) asks: "What is this about?"
PARA asks: "How will I use this?"
---
## The Four Categories
### 1. Projects (01_Projects/)
**Definition**: Time-bound initiatives with clear completion criteria
**Characteristics**:
- Has a specific end goal
- Has a deadline or completion state
- Contains discrete tasks and deliverables
- Will eventually move to Archive
**Examples**:
- Writing a research paper
- Planning a presentation
- Learning a specific skill
- Organizing an event
- Building a feature
- Planning a trip
**Structure**:
```
01_Projects/[ProjectName]/
├── README.md # Project overview, goals, timeline
├── Research/ # Background materials
├── Drafts/ # Work in progress
├── References/ # Supporting documents
└── Output/ # Final deliverables
```
**When to Archive**:
- Project objectives are met
- Project is cancelled or abandoned
- Project becomes inactive for 30+ days
---
### 2. Areas (02_Areas/)
**Definition**: Ongoing responsibilities without end dates
**Characteristics**:
- Continuous maintenance required
- Standards to uphold (not goals to achieve)
- No completion date
- Generates multiple projects over time
**Examples**:
- Health & Fitness
- Professional Development
- Finances
- Relationships
- Home Management
- Career
- Personal Growth
**Structure**:
```
02_Areas/[AreaName]/
├── Overview.md # Area definition and standards
├── Projects.md # Related project links
└── Resources.md # Helpful references
```
**Key Insight**:
Areas are **standards to maintain**, not goals to achieve.
- ✅ "Maintain health" (Area)
- ❌ "Lose 10 pounds" (Project)
**When to Archive**:
- Area is no longer relevant to your life
- Responsibility has been transferred
- Area has been inactive for 6+ months
---
### 3. Resources (03_Resources/)
**Definition**: Topics of interest for reference and learning
**Characteristics**:
- Not tied to current projects or areas
- Reference material for future use
- Long-term knowledge building
- Curated information by topic
**Examples**:
- Programming languages (Python, JavaScript)
- Historical topics (World War II, Ancient Rome)
- Philosophical concepts (Stoicism, Existentialism)
- Technical documentation (Git, Docker, APIs)
- Book notes and summaries
- Research papers
- How-to guides
**Structure**:
```
03_Resources/[TopicName]/
├── Index.md # Topic overview
├── Notes/ # Individual concept notes
└── References/ # Source materials
```
**Key Insight**:
Resources are **interests, not responsibilities**.
- If you're not actively using it → Resource
- If you must maintain it → Area
**When to Archive**:
- Information becomes outdated
- Topic is no longer of interest
- Superseded by better resources
---
### 4. Archive (04_Archive/)
**Definition**: Completed projects and inactive items
**Characteristics**:
- Completed projects (for reference)
- Inactive areas (no longer relevant)
- Outdated resources (superseded)
- Historical reference only
**Structure**:
```
04_Archive/
├── Projects/ # Completed projects
├── Areas/ # Inactive areas
└── Resources/ # Outdated resources
```
**When to Archive**:
- **Projects**: When objectives are met or abandoned
- **Areas**: When no longer relevant
- **Resources**: When superseded or no longer useful
**Archive vs. Delete**:
- Archive: May need for reference later
- Delete: Clearly useless or duplicates
---
## Decision Flow
**Where should this file go?**
```
┌─ Has a deadline or end goal?
│ └─ YES → Projects
├─ Ongoing responsibility?
│ └─ YES → Areas
├─ Just interesting information?
│ └─ YES → Resources
├─ Completed or inactive?
│ └─ YES → Archive
└─ Not sure?
└─ → Inbox (process later)
```
---
## Common Confusion
### Project vs. Area
| Question | Project | Area |
|----------|---------|------|
| Has deadline? | ✅ Yes | ❌ No |
| Can be completed? | ✅ Yes | ❌ No |
| Generates tasks? | ✅ Yes | ✅ Yes |
| Standard to maintain? | ❌ No | ✅ Yes |
**Example**:
- "Health" → Area (ongoing responsibility)
- "Train for marathon" → Project (specific goal, deadline)
### Area vs. Resource
| Question | Area | Resource |
|----------|------|----------|
| Must maintain? | ✅ Yes | ❌ No |
| Accountability? | ✅ Yes | ❌ No |
| Just interested? | ❌ No | ✅ Yes |
**Example**:
- "Professional Development" → Area (responsibility)
- "Machine Learning" → Resource (interest/learning)
---
## PARA Benefits
### 1. Fast Capture
Don't waste time deciding perfect categories. If unsure → Inbox.
### 2. Context-Based
Information is organized by how you'll use it, not what it's about.
### 3. Scalable
Works with 10 files or 10,000 files.
### 4. Action-Oriented
Focus on what needs attention now (Projects/Areas), not passive information.
### 5. Dynamic
Files move between categories as context changes.
---
## PARA in Practice
### Starting a New Project
1. Create folder: `01_Projects/[ProjectName]/`
2. Add README.md with:
- Goal and timeline
- Success criteria
- Next actions
3. Move related notes from Inbox/Resources to project folder
4. Work actively until completion
5. Archive when done
### Maintaining an Area
1. Create folder: `02_Areas/[AreaName]/`
2. Add Overview.md with:
- Definition of the area
- Standards to maintain
- Key metrics or indicators
3. Link to related projects (many projects may support one area)
4. Review during weekly review
5. Archive if no longer relevant
### Building Resources
1. Capture web content, articles, notes to Inbox
2. During processing, ask: "Is this tied to a project/area?"
- No? → Move to `03_Resources/[Topic]/`
3. Build topic collections over time
4. Reference when starting new projects
---
## Migration Tips
### From Folder-Based System
**Before** (By topic):
```
Notes/
├── Work/
├── Personal/
├── Learning/
└── Reference/
```
**After** (By actionability):
```
01_Projects/ ← Active work items
02_Areas/ ← Ongoing responsibilities
03_Resources/ ← Reference materials
04_Archive/ ← Completed items
```
### From Tag-Based System
Keep tags! PARA complements tags:
- **PARA**: Primary organization (folders)
- **Tags**: Secondary connections (cross-cutting themes)
Example:
- File: `01_Projects/Website_Redesign/wireframes.md`
- Tags: `#design #ux #client-work`
---
## Common Pitfalls
### 1. Too Many Projects
**Problem**: 20+ active projects
**Solution**: Archive inactive projects. Aim for 5-10 active projects max.
### 2. Areas Become Dumping Grounds
**Problem**: "Personal" area has 100+ unrelated notes
**Solution**: Break into specific areas or create projects for actionable items.
### 3. Never Archiving
**Problem**: Completed projects stay in Projects folder
**Solution**: Move to Archive immediately upon completion.
### 4. Over-Organizing Resources
**Problem**: Spending hours categorizing resources
**Solution**: Quick capture to Inbox, batch organize weekly.
### 5. Treating Areas as Projects
**Problem**: Expecting areas to be "completed"
**Solution**: Areas are maintained, not completed. Create projects for specific goals.
---
## Weekly Review Integration
During weekly review, ask:
**Projects**:
- [ ] Which projects are complete? → Archive
- [ ] Which projects are stalled? → Archive or reactivate
- [ ] Do areas need new projects?
**Areas**:
- [ ] Are standards being met?
- [ ] Do any areas need attention?
- [ ] Should any areas be archived?
**Resources**:
- [ ] Are resources still relevant?
- [ ] Can resources be consolidated?
- [ ] Archive outdated resources?
**Inbox**:
- [ ] Process all items into PARA
---
## Advanced: Cross-Cutting Themes
PARA handles **vertical organization** (by actionability).
Use **tags** for horizontal themes:
Example:
- Project: `01_Projects/Client_Presentation/`
- Tags: `#public-speaking #client-work #q1-2026`
This creates multi-dimensional organization:
- Find by project (folder)
- Find by theme (tags)
- Find by time (date tags)
---
## Further Reading
**Original Creator**: Tiago Forte
**Book**: *Building a Second Brain*
**Blog**: [Forte Labs](https://fortelabs.com/blog/para/)
**Related Methods**:
- GTD (Getting Things Done) - Task management
- Zettelkasten - Note-taking and connections
- PARA - Information organization
**Best Used Together**:
- PARA for organization
- Zettelkasten for linking ideas
- GTD for task execution
---
## Quick Reference
| Category | Question | Timeframe |
|----------|----------|-----------|
| **Projects** | What am I working on? | Short-term (weeks-months) |
| **Areas** | What am I responsible for? | Ongoing (no end) |
| **Resources** | What might be useful? | Long-term reference |
| **Archive** | What is completed? | Historical |
---
**Last Updated**: 2026-01-06
**See Also**: [[CLAUDE]], [[QUICK_REFERENCE]], [[WEEKLY_REVIEW]]
+679
View File
@@ -0,0 +1,679 @@
---
created: 2026-01-06
type: reference
tags: [troubleshooting, help, faq]
---
# Troubleshooting Guide
Common issues and solutions for your Obsidian vault.
---
## Quick Diagnostics
**Before anything else, run**:
```bash
git status # Check Git state
git pull # Sync latest changes
ls 00_Inbox/ # Check inbox
```
Most issues stem from: Git conflicts, file misplacement, or broken links.
---
## Git Issues
### "Permission denied (publickey)"
**Problem**: Can't push/pull from remote (SSH key issue)
**Solution 1: Use HTTPS instead**:
```bash
git remote set-url origin https://github.com/username/repo.git
git pull
```
**Solution 2: Configure SSH key**:
```bash
# Generate new SSH key
ssh-keygen -t ed25519 -C "your_email@example.com"
# Add to GitHub: Settings → SSH Keys → Add Key
# Copy public key:
cat ~/.ssh/id_ed25519.pub
```
---
### Git Conflicts After Pull
**Problem**:
```
CONFLICT (content): Merge conflict in filename.md
Automatic merge failed; fix conflicts and then commit the result.
```
**Solution**:
```bash
# 1. Check which files have conflicts
git status
# 2. Open conflicted files
# You'll see markers like:
# <<<<<<< HEAD
# Your local changes
# =======
# Remote changes
# >>>>>>> origin/main
# 3. Edit files manually, choose which version to keep
# Delete conflict markers
# 4. Stage and commit
git add .
git commit -m "Resolve merge conflicts"
git push
```
**Prevention**:
- Always `git pull` before starting work
- Commit and push at end of each session
- Don't edit same file on multiple devices simultaneously
---
### "Your branch is ahead by N commits"
**Meaning**: You have local commits not pushed to remote
**Solution**:
```bash
git push
```
---
### "Your branch is behind by N commits"
**Meaning**: Remote has commits you don't have locally
**Solution**:
```bash
git pull
```
---
### "Diverged branches"
**Meaning**: Both you and remote have different commits
**Solution**:
```bash
git pull # Will attempt auto-merge
# If conflicts occur, resolve manually (see above)
git add .
git commit -m "Resolve merge conflicts"
git push
```
---
### Accidentally Committed Sensitive File
**Immediate Action**:
```bash
# Remove from Git tracking (keep local file)
git rm --cached sensitive-file.txt
# Add to .gitignore
echo "sensitive-file.txt" >> .gitignore
# Commit removal
git add .gitignore
git commit -m "Remove sensitive file from tracking"
git push
```
**⚠️ Warning**: File still exists in Git history. For complete removal, use BFG Repo-Cleaner (advanced).
---
### Completely Reset to Remote
**⚠️ DANGER**: This discards ALL local changes
**Use when**: Local changes are broken beyond repair
```bash
# Backup first (if anything is valuable)
cp -r . ../vault-backup
# Reset to remote
git fetch origin
git reset --hard origin/main
git clean -fd
```
---
## File Organization Issues
### Inbox Overflow (> 50 items)
**Problem**: Inbox has too many unprocessed items
**Solution**:
```bash
# 1. Count items
ls 00_Inbox/ | wc -l
# 2. Schedule 30-60 minute processing session
# 3. Quick triage:
# - Delete: Low-value items
# - Archive: Outdated items
# - Quick process: Easy decisions
# - Batch process: Similar items together
# 4. Set calendar reminder for weekly review
```
**Prevention**:
- Process inbox weekly (non-negotiable)
- Capture fast, don't organize while capturing
- Use `#needs-processing` tag for complex items
---
### Can't Find a File
**Scenario**: You know a file exists but can't locate it
**Solution 1: Obsidian Search**:
```
Ctrl+Shift+F (or Cmd+Shift+F)
```
**Solution 2: Command line search**:
```bash
# Search by filename
find . -name "*keyword*"
# Search by content
grep -r "keyword" . --include="*.md"
# Search with context
grep -r -C 3 "keyword" . --include="*.md"
```
**Solution 3: Check common locations**:
```bash
ls 00_Inbox/ # Recently added?
ls 04_Archive/ # Already archived?
git log --all --full-history -- "*keyword*" # Deleted?
```
**Solution 4: Git history**:
```bash
# Find when file was moved/deleted
git log --all --full-history --summary | grep filename
# See file contents from past
git show <commit-hash>:path/to/file.md
```
---
### Broken Links After Moving Files
**Problem**: Moved a file, now links are broken
**Solution 1: Use update script**:
```bash
pnpm attachments:update-links
```
**Solution 2: Manual search and replace**:
```bash
# Find all references to old path
grep -r "old-filename" . --include="*.md"
# Update manually in each file
```
**Solution 3: Obsidian's built-in update**:
- Obsidian automatically updates `[[wiki-links]]` when you move files in the app
- Use Obsidian file explorer to move files when possible
**Prevention**:
- Use Obsidian's file explorer to move files (auto-updates links)
- Or use `pnpm attachments:update-links` after moving
- Commit changes after any reorganization
---
### File in Wrong Folder
**Problem**: File is in wrong PARA category
**Solution**:
```bash
# 1. Verify destination exists
ls 01_Projects/TargetProject/
# 2. Move file
mv "02_Areas/wrongplace/file.md" "01_Projects/TargetProject/file.md"
# 3. Update any links (if needed)
pnpm attachments:update-links
# 4. Commit
git add .
git commit -m "Organize: Moved file.md to correct location"
git push
```
---
## Attachment Issues
### Orphaned Attachments
**Problem**: Attachments in `05_Attachments/` not referenced anywhere
**Solution**:
```bash
# Find orphaned files
pnpm attachments:orphans
# Review each orphan:
# - Delete if truly unused
# - Or add reference to a note
```
---
### Broken Image/Attachment Links
**Problem**: `![[image.png]]` shows as broken link
**Causes**:
1. File doesn't exist
2. File path is wrong
3. File name has typo
**Solution**:
```bash
# 1. Check if file exists
ls 05_Attachments/ | grep image
# 2. Check organized folder
ls 05_Attachments/Organized/ | grep image
# 3. Search for file anywhere
find . -name "*image*"
# 4. Update link in note to correct path
```
**Prevention**:
- Use Obsidian's drag-and-drop to insert attachments (auto-correct paths)
- Keep attachments organized in `05_Attachments/`
- Use descriptive file names
---
### Attachment Folder Too Large
**Problem**: `05_Attachments/` is taking up too much space
**Solution**:
```bash
# 1. Check sizes
pnpm attachments:sizes
# 2. Identify large files
find 05_Attachments -type f -size +10M
# 3. Options:
# - Compress images (use online tools)
# - Delete unused files (check with orphans script)
# - Move large videos outside vault (link externally)
```
**Prevention**:
- Compress images before adding
- Link to large videos externally (Google Drive, Dropbox)
- Regularly clean up unused attachments
---
## Command/Script Issues
### "pnpm: command not found"
**Problem**: Node.js/pnpm not installed or not in PATH
**Solution**:
```bash
# Install pnpm
npm install -g pnpm
# Or use npx instead
npx pnpm attachments:list
```
---
### Script Fails with "Permission denied"
**Problem**: Script doesn't have execute permissions
**Solution**:
```bash
# Add execute permission
chmod +x .scripts/script-name.sh
# Or run with bash explicitly
bash .scripts/script-name.sh
```
---
### Firecrawl Scripts Fail
**Problem**: `pnpm firecrawl:scrape` returns errors
**Common Causes**:
1. API key not set
2. Proxy not configured (if behind firewall)
3. Invalid URL
**Solution**:
```bash
# 1. Set up environment
source .scripts/setup-firecrawl-env.sh
# 2. Verify environment
echo $FIRECRAWL_API_KEY # Should show your key
echo $HTTP_PROXY # Should show proxy (if needed)
# 3. Test with simple URL
pnpm firecrawl:scrape "https://example.com" "test.md"
# 4. Check output
cat 00_Inbox/Clippings/test.md
```
---
## Obsidian App Issues
### Vault Not Syncing Properly
**Problem**: Changes in Obsidian don't appear in Git
**Cause**: Obsidian auto-save might be delayed
**Solution**:
1. Manually save note: `Ctrl+S` (or `Cmd+S`)
2. Wait 1-2 seconds for file to write
3. Then run `git status` to verify
---
### "This vault is not an Obsidian vault"
**Problem**: Obsidian doesn't recognize vault folder
**Solution**:
```bash
# Check if .obsidian folder exists
ls -la .obsidian/
# If missing, re-open as vault in Obsidian:
# File → Open Folder as Vault → Select vault directory
```
---
### Plugins Not Working
**Problem**: Installed plugins don't appear or function
**Solution**:
1. Check `.obsidian/community-plugins.json` exists
2. Settings → Community Plugins → Ensure not in restricted mode
3. Restart Obsidian
4. Re-enable plugins in Settings
---
## Workflow Issues
### Weekly Review Not Happening
**Problem**: Haven't done weekly review in weeks
**Solution**:
```bash
# 1. Schedule 30-45 minutes NOW
# 2. Open WEEKLY_REVIEW.md
# 3. At minimum, process inbox:
ls 00_Inbox/
# Move items to proper locations
# 4. Set recurring calendar reminder:
# "Weekly Review - Every Sunday 10am"
```
---
### Too Many Active Projects
**Problem**: 20+ projects, feeling overwhelmed
**Solution**:
```bash
# 1. List projects
ls 01_Projects/
# 2. For each project, ask:
# - Worked on in last 30 days? → Keep active
# - Haven't touched in 30+ days? → Archive
# - No longer relevant? → Archive
# 3. Archive inactive projects
mv "01_Projects/OldProject" "04_Archive/Projects/OldProject"
# 4. Aim for 5-10 active projects maximum
```
---
### Areas Becoming Dumping Grounds
**Problem**: An area has 50+ unrelated notes
**Solution**:
1. **Review contents**: What are these notes about?
2. **Create sub-areas or projects**: Group related notes
3. **Move to resources**: If just reference material
4. **Archive**: If outdated
**Example**:
```
Before:
02_Areas/Personal/
├── health-tip-1.md
├── health-tip-2.md
├── budget-2025.md
├── workout-plan.md
├── ... (50 more files)
After:
02_Areas/Health/ ← New area
├── workout-plan.md
└── health-tips/
02_Areas/Finances/ ← New area
└── budget-2025.md
03_Resources/Health/ ← Reference materials
└── health-tips/
```
---
## Performance Issues
### Obsidian Slow to Start
**Causes**:
1. Too many plugins
2. Vault too large
3. Indexing large files
**Solution**:
1. Disable unused plugins: Settings → Community Plugins
2. Archive old files: Move to `04_Archive/`
3. Exclude large folders from search: Settings → Files & Links → Excluded files
---
### Git Operations Slow
**Causes**:
1. Large binary files in repo
2. Too many commits in history
**Solution**:
```bash
# Check repo size
du -sh .git
# Find large files
find . -type f -size +10M
# Consider:
# - Git LFS for large files
# - .gitignore for unnecessary files
# - Clean up old binary files
```
---
## Data Recovery
### Accidentally Deleted File
**Solution 1: Git history**:
```bash
# Find when file was deleted
git log --all --full-history -- "path/to/file.md"
# Restore from specific commit
git checkout <commit-hash> -- "path/to/file.md"
```
**Solution 2: Obsidian's file recovery**:
- `.obsidian/plugins/file-recovery/` (if plugin enabled)
**Solution 3: System file recovery**:
- Windows: Recycle Bin
- Mac: Trash
- Linux: `~/.local/share/Trash/`
---
### Vault Corrupted
**⚠️ Extreme Case**:
**Solution**:
```bash
# 1. Stop and assess damage
git status
# 2. If Git is intact, reset to last known good state
git log --oneline -20
git reset --hard <good-commit-hash>
# 3. If Git is broken, clone from remote
cd ..
git clone <remote-url> vault-restored
cd vault-restored
```
**Prevention**:
- Commit daily (creates restore points)
- Push to remote (offsite backup)
- Optional: External backup (Google Drive, Dropbox)
---
## Getting Help
### Self-Help Checklist
Before asking for help:
- [ ] Checked this troubleshooting guide
- [ ] Ran `git status` and `git pull`
- [ ] Searched Obsidian forums
- [ ] Googled the error message
- [ ] Checked [[GIT_WORKFLOW]] for Git issues
- [ ] Reviewed [[QUICK_REFERENCE]] for commands
---
### Ask AI Assistant
**Effective Questions**:
```
✅ "How do I move files from Inbox to Projects?"
✅ "I'm getting this error: [paste error]. How do I fix it?"
✅ "What's the difference between Areas and Resources?"
❌ "It's broken" (too vague)
❌ "Nothing works" (no context)
```
---
### External Resources
**Obsidian Forums**: https://forum.obsidian.md/
**Git Documentation**: https://git-scm.com/doc
**PARA Method**: https://fortelabs.com/blog/para/
---
## Preventive Maintenance
### Daily
- [ ] `git pull` at start
- [ ] `git push` at end
### Weekly
- [ ] Process inbox
- [ ] Review active projects
- [ ] Run `pnpm attachments:orphans`
### Monthly
- [ ] Archive completed projects
- [ ] Clean up orphaned attachments
- [ ] Review and consolidate resources
### Quarterly
- [ ] Deep archive review
- [ ] Check `.gitignore` is up to date
- [ ] Update documentation (CLAUDE.md, etc.)
---
**Last Updated**: 2026-01-06
**See Also**: [[CLAUDE]], [[QUICK_REFERENCE]], [[GIT_WORKFLOW]]
@@ -0,0 +1,123 @@
---
title: Templater 快速参考
created: 2026-01-05
updated: 2026-01-05
tags:
- obsidian
- templater
- quick-reference
- reference
type: reference
---
# Templater 快速参考
> 📌 **快速指南**:Templater 插件常用语法和命令速查表
## 🔥 常用语法(复制即用)
### 日期时间
```templater
今天:<% tp.date.now("YYYY-MM-DD") %>
现在:<% tp.date.now("HH:mm") %>
明天:<% tp.date.tomorrow("YYYY-MM-DD") %>
昨天:<% tp.date.yesterday("YYYY-MM-DD") %>
本周一:<% tp.date.weekday("YYYY-MM-DD", 1) %>
```
### 文件信息
```templater
文件名:<% tp.file.title %>
文件夹:<% tp.file.folder() %>
创建时间:<% tp.file.creation_date("YYYY-MM-DD HH:mm") %>
```
### 用户交互
```templater
输入框:<% tp.system.prompt("提示文字") %>
下拉选择:<% tp.system.suggester(["选项1", "选项2"], ["值1", "值2"]) %>
光标位置:<% tp.file.cursor() %>
```
### 文件操作
```javascript
// 创建新笔记
<%* await tp.file.create_new("模板名", "文件名", false, "文件夹") %>
// 移动文件
<%* await tp.file.move("新路径/新文件名") %>
// 包含其他文件
<% tp.file.include("[[笔记名]]") %>
```
## ⌨️ 快捷键(需要先设置)
| 功能 | 推荐快捷键 |
|------|-----------|
| 从模板创建新笔记 | `Ctrl/Cmd + Shift + N` |
| 插入模板到当前笔记 | `Ctrl/Cmd + T` |
| 执行模板代码 | `Ctrl/Cmd + R` |
## 📁 模板文件位置
```
06_Metadata/Templates/
├── daily-note.md # 每日笔记
├── project.md # 项目管理
├── meeting.md # 会议记录
├── quick-note.md # 快速笔记
├── book-note.md # 读书笔记
└── person.md # 人脉管理
```
## 🎯 三步使用流程
1. **按快捷键** `Ctrl/Cmd + Shift + N`(或 `Ctrl/Cmd + P` → 搜索 "Templater"
2. **选择模板**(如 `daily-note.md`
3. **输入文件名**,完成!
## 🛠️ 配置检查清单
- [ ] 设置模板文件夹:`06_Metadata/Templates`
- [ ] 启用 "Trigger Templater on new file creation"
- [ ] 启用 "Enable Folder Templates"
- [ ] 配置文件夹模板映射
- [ ] 设置快捷键
## 💡 实用代码片段
### 自动生成今日链接
```
[[<% tp.date.now("YYYY-MM-DD") %>]]
```
### 带提示的项目笔记
```markdown
---
project: <% tp.system.prompt("项目名称") %>
created: <% tp.date.now("YYYY-MM-DD") %>
---
# <% tp.system.prompt("项目名称") %>
```
### 智能状态选择
```javascript
<%*
const status = await tp.system.suggester(
["🟢 进行中", "🟡 计划中", "🔴 已完成"],
["active", "planned", "completed"]
);
tR += status;
%>
```
## 🔗 相关文档
- [[Templater-Setup-Guide|Templater Setup Guide]]
- [[Templater-User-Guide|Templater User Guide]]
---
**提示**:将这个笔记固定在侧边栏,随时查阅!
@@ -0,0 +1,170 @@
---
title: Templater 配置步骤
created: 2026-01-05
updated: 2026-01-05
tags:
- obsidian
- templater
- setup
- guide
- reference
type: reference
---
# Templater 配置步骤
## 🎯 快速开始(3步完成配置)
### 第 1 步:配置模板文件夹
1. 打开 Obsidian 设置(`Ctrl/Cmd + ,`
2. 在左侧找到 **Templater** 插件
3. 在 "Template folder location" 中输入:`06_Metadata/Templates`
4. ✅ 勾选 "Trigger Templater on new file creation"(创建新文件时自动触发)
### 第 2 步:设置文件夹模板(可选但推荐)
在 Templater 设置中:
1. ✅ 勾选 "Enable Folder Templates"
2. 点击 "Add New" 添加文件夹模板映射
3. 推荐的映射:
| 文件夹 | 模板文件 | 说明 |
|--------|---------|------|
| `00_Inbox` | `06_Metadata/Templates/quick-note.md` | 收件箱快速笔记 |
| `01_Projects` | `06_Metadata/Templates/project.md` | 项目笔记 |
| `03_Resources/Books` | `06_Metadata/Templates/book-note.md` | 读书笔记 |
**配置方法**
- **Folder**:输入文件夹路径(如 `00_Inbox`
- **Template**:选择模板文件(如 `06_Metadata/Templates/quick-note.md`
### 第 3 步:设置快捷键(推荐)
1. 打开 Obsidian 设置 → **快捷键**
2. 搜索 "Templater"
3. 为以下命令设置快捷键:
| 命令 | 推荐快捷键 | 功能 |
|------|-----------|------|
| `Templater: Create new note from template` | `Ctrl/Cmd + Shift + N` | 从模板创建新笔记 |
| `Templater: Insert Template` | `Ctrl/Cmd + T` | 在当前笔记插入模板 |
| `Templater: Replace templates in the active file` | `Ctrl/Cmd + R` | 执行当前文件中的模板代码 |
## 📚 已创建的模板
你的 vault 中现在有以下模板可用:
1. **daily-note.md** - 每日笔记模板
- 适合:日记、每日计划、工作日志
- 包含:任务列表、笔记区、想法记录
2. **project.md** - 项目管理模板
- 适合:项目规划、OKR 跟踪
- 包含:目标、时间线、团队成员、进展记录
3. **meeting.md** - 会议记录模板
- 适合:各类会议记录
- 包含:议程、讨论内容、行动项
4. **quick-note.md** - 快速笔记模板
- 适合:临时想法、收件箱笔记
- 包含:基本元数据和时间戳
5. **book-note.md** - 读书笔记模板
- 适合:书籍阅读记录
- 包含:书籍信息、核心观点、读书笔记
6. **person.md** - 人脉管理模板
- 适合:联系人信息管理
- 包含:基本信息、互动记录
## 🚀 如何使用模板
### 方法 1:命令面板(推荐新手)
1.`Ctrl/Cmd + P` 打开命令面板
2. 输入 "Templater"
3. 选择 "Templater: Create new note from template"
4. 选择你想使用的模板
5. 输入新文件名
### 方法 2:快捷键(推荐熟练用户)
1. 按你设置的快捷键(如 `Ctrl/Cmd + Shift + N`
2. 选择模板
3. 输入文件名
### 方法 3:自动应用(需要配置文件夹模板)
1. 在指定的文件夹中创建新笔记
2. 模板会自动应用(如果你在第2步配置了文件夹模板)
### 方法 4:在现有笔记中插入
1. 打开一个现有笔记
2.`Ctrl/Cmd + T`(或你设置的快捷键)
3. 选择要插入的模板
## 🎨 自定义模板
### 修改现有模板
1. 打开 `06_Metadata/Templates/` 文件夹
2. 编辑任何 `.md` 模板文件
3. 保存后立即生效
### 创建新模板
1.`06_Metadata/Templates/` 创建新的 `.md` 文件
2. 使用 Templater 语法编写模板
3. 参考 [[Templater-User-Guide|Templater User Guide]] 了解语法
## 💡 实用技巧
### 技巧 1:动态文件名
创建新笔记时,使用日期作为文件名:
```
<% tp.date.now("YYYY-MM-DD") %>-<% tp.system.prompt("笔记标题") %>
```
### 技巧 2:智能提示
在模板中使用下拉选择:
```javascript
<% tp.system.suggester(["高", "中", "低"], ["high", "medium", "low"]) %>
```
### 技巧 3:包含其他模板
在一个模板中包含另一个模板的内容:
```
<% tp.file.include("[[06_Metadata/Templates/common-header]]") %>
```
## ❓ 常见问题
### Q: 模板中的代码没有执行?
**A**: 确保你使用了正确的触发命令:
- 创建新笔记:使用 "Create new note from template"
- 执行现有文件:使用 "Replace templates in the active file"
### Q: 想要每天自动创建日记?
**A**: 结合 **Calendar****Periodic Notes** 插件,设置每日笔记模板为 `daily-note.md`
### Q: 如何查看所有可用的 Templater 函数?
**A**: 阅读 [[Templater-User-Guide|Templater User Guide]] 或访问官方文档
## 📖 延伸阅读
- [[Templater-User-Guide|Templater User Guide]]
- [[Templater-Quick-Reference|Templater Quick Reference]]
- 官方文档:https://silentvoid13.github.io/Templater/
---
**提示**:配置完成后,建议先测试一下 `quick-note.md` 模板,熟悉流程后再使用其他模板。
**创建日期**2026-01-05
@@ -0,0 +1,250 @@
---
title: Templater 使用指南
created: 2026-01-05
updated: 2026-01-05
tags:
- obsidian
- templater
- guide
- reference
type: reference
---
# Templater 使用指南
## 什么是 Templater
Templater 是 Obsidian 最强大的模板插件,它允许你创建动态模板,使用变量、函数和命令来自动化你的笔记创建流程。
## 核心功能
### 1. 基本语法
Templater 使用 `<% %>` 标签来执行代码:
- `<% code %>` - 执行代码但不输出
- `<%= value %>` - 执行代码并输出结果
- `<%* async code %>` - 执行异步代码
### 2. 内置变量
#### 日期和时间
```
<% tp.date.now("YYYY-MM-DD") %> # 当前日期:2026-01-05
<% tp.date.now("HH:mm") %> # 当前时间:14:30
<% tp.date.now("YYYY-MM-DD HH:mm:ss") %> # 完整时间戳
<% tp.date.tomorrow("YYYY-MM-DD") %> # 明天的日期
<% tp.date.yesterday("YYYY-MM-DD") %> # 昨天的日期
<% tp.date.weekday("YYYY-MM-DD", 0) %> # 本周日(0=周日)
```
#### 文件信息
```
<% tp.file.title %> # 当前文件标题(不含扩展名)
<% tp.file.creation_date() %> # 文件创建日期
<% tp.file.folder() %> # 文件所在文件夹
<% tp.file.path() %> # 文件完整路径
```
#### 配置信息
```
<% tp.config.active_file.basename %> # 活动文件名
<% tp.config.active_file.path %> # 活动文件路径
```
### 3. 常用命令
#### 文件操作
```javascript
// 创建新笔记
<%* await tp.file.create_new("模板名", "新文件名", false, "目标文件夹") %>
// 移动文件
<%* await tp.file.move("新路径/新文件名") %>
// 重命名文件
<%* await tp.file.rename("新文件名") %>
// 包含其他文件
<% tp.file.include("[[其他笔记名称]]") %>
```
#### 用户输入
```javascript
// 提示用户输入
<% tp.system.prompt("请输入项目名称") %>
// 建议列表(下拉选择)
<% tp.system.suggester(["选项1", "选项2", "选项3"], ["value1", "value2", "value3"]) %>
```
### 4. 实用示例
#### 示例1:每日笔记模板
```markdown
---
date: <% tp.date.now("YYYY-MM-DD") %>
day: <% tp.date.now("dddd") %>
week: <% tp.date.now("YYYY-[W]WW") %>
---
# <% tp.date.now("YYYY-MM-DD dddd") %>
## 📋 今日任务
- [ ]
## 📝 笔记
## 🎯 重点事项
## 💡 想法与灵感
---
← [[<% tp.date.yesterday("YYYY-MM-DD") %>]] | [[<% tp.date.tomorrow("YYYY-MM-DD") %>]] →
```
#### 示例2:项目笔记模板
```markdown
---
type: project
created: <% tp.date.now("YYYY-MM-DD") %>
status: active
---
# <% tp.system.prompt("项目名称") %>
## 📋 项目概述
<% tp.system.prompt("项目简介") %>
## 🎯 目标
-
## 📅 关键时间节点
- 开始时间:<% tp.date.now("YYYY-MM-DD") %>
- 截止时间:
## 👥 相关人员
-
## 📎 相关资源
-
## 📝 进展记录
### <% tp.date.now("YYYY-MM-DD") %>
-
```
#### 示例3:会议记录模板
```markdown
---
type: meeting
date: <% tp.date.now("YYYY-MM-DD HH:mm") %>
participants:
---
# 会议记录 - <% tp.system.prompt("会议主题") %>
**时间**<% tp.date.now("YYYY-MM-DD HH:mm") %>
**地点**<% tp.system.prompt("会议地点") %>
**参与者**
## 📋 议程
1.
## 📝 讨论内容
## ✅ 行动项
- [ ]
## 🔗 相关资料
```
## 如何使用
### 方法1:快捷键触发
1. 打开设置 → 快捷键
2. 搜索 "Templater: Insert Template"
3. 设置一个快捷键(如 `Ctrl/Cmd + T`
4. 在笔记中按快捷键选择模板
### 方法2:命令面板
1.`Ctrl/Cmd + P` 打开命令面板
2. 输入 "Templater"
3. 选择 "Templater: Insert Template"
4. 选择要插入的模板
### 方法3:创建新笔记时自动应用
1. 在设置中配置 "Folder Templates"
2. 为不同文件夹指定默认模板
3. 在该文件夹创建新笔记时自动应用模板
## 配置建议
### 1. 创建模板文件夹
建议在 `06_Metadata/Templates` 下创建所有模板文件
### 2. Templater 设置
- **Template folder location**: `06_Metadata/Templates`
- **Trigger Templater on new file creation**: ✓ 启用
- **Enable folder templates**: ✓ 启用
### 3. 文件夹模板映射示例
| 文件夹 | 模板 |
|--------|------|
| `00_Inbox` | `quick-note.md` |
| `01_Projects` | `project.md` |
| `02_Areas` | `area.md` |
| `06_Metadata/Daily` | `daily-note.md` |
## 进阶技巧
### 1. JavaScript 代码块
```javascript
<%*
// 可以写多行 JavaScript 代码
const projectName = await tp.system.prompt("项目名称");
const status = await tp.system.suggester(
["进行中", "计划中", "已完成"],
["active", "planned", "completed"]
);
tR += `项目:${projectName}\n状态:${status}`;
%>
```
### 2. 条件逻辑
```javascript
<%* if (tp.file.folder().includes("Projects")) { %>
这是一个项目笔记
<%* } else { %>
这是一个普通笔记
<%* } %>
```
### 3. 循环生成内容
```javascript
<%* for (let i = 1; i <= 5; i++) { %>
## <%= i %> 部分
<%* } %>
```
## 常见问题
### Q: 模板不生效?
A: 检查 Templater 设置中的模板文件夹路径是否正确
### Q: 如何在已有笔记中插入模板?
A: 使用命令 "Templater: Insert Template" 或快捷键
### Q: 可以创建自定义函数吗?
A: 可以!在 Templater 设置中配置 "User Scripts" 文件夹
## 相关资源
- 官方文档:https://silentvoid13.github.io/Templater/
- 示例模板库:查看 `06_Metadata/Templates/` 文件夹
---
**标签**#教程 #Templater #Obsidian #模板
**创建日期**<% tp.date.now("YYYY-MM-DD") %>