Auto Frontmatter on Folder Structure
unlistedby Pine885
Automatically tags notes and creates structural links (siblings, parents, children) based on folder hierarchy.
Auto Frontmatter Notes by Folder Structure
Obsidian plugin that transforms your folder hierarchy into a rich network of automated tags and structural links within your note frontmatter.
๐ Overview
Instead of manually managing tags and links, this plugin treats your folder structure as a source of truth. It automatically generates metadata that describes where a note lives, who its neighbors are, and how it relates to the broader vault architecture.
โจ Key Features
๐ท๏ธ Automatic Path-based Tagging
Convert your folder paths into a clean set of tags.
- Dynamic Hierarchy: Automatically generates tags based on the folder path.
- Configurable Depth: Use
Tag Depthto control how many levels of the hierarchy are converted into tags (e.g.,1for the immediate parent,2+for a deeper ancestral chain).
๐ Multi-Depth Structural Linking
Create a web of relationships between notes based on their physical location in the vault.
- Parents: Links to notes in parent folders.
- Siblings: Links to other notes in the same folder.
- Children: Links to notes in subfolders.
- Cousins (Dynamic Relationships): Define custom relationships by adding a
FolderName-[R]key. The plugin will find all folders with that name across your entire vault and link the notes within them. - Strict Sorting: Keys are always organized in a logical order:
Parents$\rightarrow$Siblings$\rightarrow$Children$\rightarrow$Cousins.
๐ Intelligent Folder Summaries
Bring folder-level context directly into your notes.
- Automatic Extraction: The plugin looks for a
summary.mdfile (or similar) in a folder and extracts its content. - Smart Detection: Uses a priority-based search:
Exact Match$\rightarrow$Starts With$\rightarrow$Ends With$\rightarrow$Contains. - Clean Text: Automatically strips YAML frontmatter and markdown formatting to provide a clean, plain-text summary.
- Comprehensive Coverage: Summaries are available for Parents, Siblings, Children, and Cousins.
โก High-Performance Automation
Designed for large vaults and seamless workflows.
- Real-time Triggers: Updates are triggered automatically when notes are moved, renamed, deleted, or opened.
- Pro Queue Architecture: Uses a debounced batch processing system to prevent UI lag and avoid sync loops with cloud services (iCloud/Dropbox).
- Configurable Delay: Adjust the
Update Delayto balance responsiveness and CPU usage. - Dirty Checking: Only writes to the file if the calculated metadata actually differs from the current frontmatter, minimizing disk I/O.
๐งน Maintenance & Safety
- Ghost Key Removal: Automatically detects and deletes obsolete structural keys when folders are renamed or moved.
- Folder Targets: Precisely control which notes are processed using Whitelist and Blacklist filters.
- Vault-Wide Wipe: A "Clear All Frontmatter" utility for a fresh start.
โ๏ธ Configuration Guide
Main Settings
- New User Guide: A quick start guide to help you configure the plugin.
- Quick Run: A button to immediately process all files in your vault.
- Ribbon Visibility: Toggle which quick-access icons appear in your Obsidian ribbon:
Run Auto-Frontmatter: Process all files.Auto-Frontmatter Active Note: Process only the current file.Clear All Frontmatter: Wipe all structural metadata from the vault.Clear Active-Note Frontmatter: Wipe metadata from the current file.
- Folder Targets: Precisely control which notes are processed using Whitelist and Blacklist filters.
- Whitelisted Folders: Only process notes in these folders. If left empty, the plugin targets all folders in your vault.
- Blacklisted Folders: Completely ignore specific directories (e.g.,
Archive,Templates) to keep your metadata clean.
- Clear Frontmatter: A utility to remove all automated frontmatter properties for a fresh start.
Automation Settings
- Enable Automation: Toggle real-time updates.
- Update Delay: Time (ms) to wait before processing the queue. Lower = faster, Higher = lighter on CPU.
Auto Tag Settings
- Enable Tagging: Toggle path-to-tag conversion.
- Tag Depth:
0= Clear tags,1= Immediate parent,2+= Hierarchy.
Auto Link Settings
- Enable Linking: Toggle structural linking.
- Link Depth:
0= Cousins only,1= Siblings + Cousins,2+= Hierarchy + Siblings + Cousins. - Cousin Links: Add
FolderName-[R]:to your properties to link all notes in any folder namedFolderNameacross your vault. This will also automatically add#FolderNameto your tags.
Summary Settings
- Enable Summary: Toggle folder summary extraction.
- Full Text: If disabled, only the first paragraph is used.
- Strict Summary Name: If enabled, only files named exactly "summary" are used.
- Detection Priority: The fixed hierarchy used to find summary files.
๐ Frontmatter Reference
| Suffix | Meaning | Description |
|---|---|---|
-[TP n] | Parent Summary | Summary of the parent folder at depth n. |
-[P n] | Parent (Level n) | Link to the note in the parent folder at depth n. |
-[TS] | Sibling Summary | Summary of the current folder. |
-[S] | Siblings | Links to other notes in the same folder. |
-[TC n] | Child Summary | Summary of the subfolder at depth n. |
-[C n] | Child (Level n) | Links to notes in subfolders at depth n. |
-[TR] | Cousin Summary | Summary of the cousin folder. |
-[R] | Cousins | Links to notes in any folder with the specified name. |
๐ Example
Scenario: A note located at Projects/Active/Work/Task.md
- Tag Depth: 2
- Link Depth: 2
- Cousin Key:
Resources-[R]added manually.
Resulting Frontmatter:
tags:
- #Active
- #Work
Projects-[TP2]: "The main project hub."
Projects-[P2]: [[Project Root]]
Active-[TP1]: "Current active projects."
Active-[P1]: [[Active Folder Note]]
Work-[TS]: "Work-related tasks and notes."
Work-[S]: [[Note A], [Note B]]
Work-[TC1]: "Detailed sub-task breakdown."
Work-[C1]: [[Sub-task 1], [Sub-task 2]]
Resources-[TR]: "Global resource library."
Resources-[R]: [[Resource A], [Resource B]]
๐ Installation
Manual Installation
- Download
main.jsandmanifest.json. - Create a folder
.obsidian/plugins/obsidian-auto-frontmatterin your vault. - Place the files inside and restart Obsidian.
For Developers
- Clone the repository.
- Run
npm install. - Run
npm run buildto compile TypeScript tomain.js.
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.