mirror of
https://github.com/al0cam/AutoMover.git
synced 2026-07-22 12:10:26 +00:00
1.9 KiB
1.9 KiB
Project Rules
Project rules allow you to organize files by project using frontmatter metadata. Files with a Project or project field in their frontmatter will be matched against project rules first, before checking regular moving rules or tag rules.
How Project Rules Work
- Frontmatter matching: Add a
Projectorprojectfield to your file's frontmatter - Project folder: Each project rule has a base folder where all project files go
- Sub-rules: Within each project, you can define moving rules that work just like regular moving rules
- Fallback to project root: If no sub-rule matches, the file is moved to the project root folder
Project Rule Precedence
The plugin checks rules in this order:
- Project rules (if file has
Projectfrontmatter) - Moving rules (filename-based)
- Tag rules (tag-based)
Fallback Behavior
Files with project frontmatter will always end up in their project folder, even if no specific rule matches:
- No sub-rules defined: File goes to project root folder
- No sub-rule matches: File goes to project root folder
- Sub-rule with empty folder or
./: File goes to project root folder - Sub-rule with specific folder: File goes to that subfolder within the project
Example
Imagine you have a project called "Book Collection" with the following structure:
File frontmatter:
---
Project: Book Collection
---
Project rule setup:
- Project name:
Book Collection - Project folder:
Projects/Books - Sub-rules:
- Regex:
Chapter→ Folder:Chapters - Regex:
Character→ Folder:Characters - Regex:
Index→ Folder:./
- Regex:
Results:
Chapter 1.md→Projects/Books/Chapters/Chapter 1.mdCharacter Notes.md→Projects/Books/Characters/Character Notes.mdIndex.md→Projects/Books/Index.md(using./moves to project root)Random Note.md→Projects/Books/Random Note.md(no matching rule, goes to project root)