Skip to content

feat: add ignore folders on file creation setting#1710

Open
C-Bjorn wants to merge 5 commits intoSilentVoid13:masterfrom
C-Bjorn:feature/ignore-folders-on-creation
Open

feat: add ignore folders on file creation setting#1710
C-Bjorn wants to merge 5 commits intoSilentVoid13:masterfrom
C-Bjorn:feature/ignore-folders-on-creation

Conversation

@C-Bjorn
Copy link
Copy Markdown

@C-Bjorn C-Bjorn commented Mar 28, 2026

Summary

Adds a new setting under Trigger Templater on new file creation that lets users specify folders where Templater's file creation handler should be skipped entirely.

Files created inside these folders (and all subfolders) will not trigger the on_file_creation handler, preventing Templater syntax from being inadvertently stripped by other plugins or automation workflows.

Changes

  • src/settings/Settings.ts

    • New IgnoreFolderOnCreation interface
    • Added ignore_folders_on_creation to DEFAULT_SETTINGS and Settings interface
    • New add_ignore_folders_on_creation_setting() method shown first in the trigger section, above Folder templates and File regex templates
    • Supports add / move up / move down / delete, with FolderSuggest autocomplete
  • src/core/Templater.ts

    • Early-return guard added in on_file_creation() before delay(300), using normalizePath + startsWith

Testing

Tested locally in Obsidian:

  • Ignored folder setting appears and saves correctly
  • Files created in ignored folders are NOT processed by Templater
  • Files created outside ignored folders continue to work normally

Copy link
Copy Markdown
Collaborator

@Zachatoo Zachatoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please resolve the merge conflicts and make the requested changes? Thank you!

Comment thread manifest.json Outdated
"id": "templater-obsidian",
"name": "Templater",
"version": "2.18.1",
"version": "2.19.0-beta.1",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't change version numbers in this file or other files, I have an automated process for that

Comment thread .github/workflows/release.yml Outdated
- name: npm build
run: |
npm install
npm install --legacy-peer-deps
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've resolved this in a different way, when you resolve conflicts please take my changes

@C-Bjorn
Copy link
Copy Markdown
Author

C-Bjorn commented Apr 21, 2026

Hi @Zachatoo — both review items have been addressed in the latest commit (1d4150e):

  1. Version numbers — reverted manifest.json back to 2.18.1. No version changes in this PR.
  2. release.yml — replaced the --legacy-peer-deps hack with the pnpm/action-setup@v4 + pnpm install approach you landed in master.

I'll also resolve any remaining merge conflicts against current master. Ready for re-review when you have a chance.

…lders-on-creation

# Conflicts:
#	package.json
#	versions.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants