diff --git a/CHANGELOG.md b/CHANGELOG.md
index aa368eb..57755e1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [1.1.3] - 2024-12-20
+
+### Fixed
+
+- Adds "template on rename" setting back into settings, disabled by default.
+- Consolidates template prepend logic to ensure both note creation and rename
+ events atomically read the content of an existing note before prepending a template.
+
## [1.1.2] - 2024-12-19
### Fixed
diff --git a/README.md b/README.md
index b77293b..ad6d2ad 100644
--- a/README.md
+++ b/README.md
@@ -3,7 +3,7 @@
This is a simple [Obsidian](https://obsidian.md/) plugin to automatically template notes
-based on their name when created. Users can template notes that match
+based on their name when created or renamed. Users can template notes that match
their desired naming conventions with any template that exists in their
specified templates folder (including sub-folders).
@@ -18,6 +18,8 @@ Examples:
- **Quicker templating**: Automatically template notes based on their name at creation time
- **Customizable**: Users can create rules to template notes based on their personal naming conventions
- **Multiple match options**: Choose from prefix, suffix, or contains to template notes
+- **Optionally template on rename**: Choose whether or not to template notes when they are renamed
+ If a note is renamed to a matching template, the template content will be prepended to the existing note.
- **Case sensitivity options**: Choose whether or not to match note names against rules in a case-sensitive manner
## Installation
diff --git a/docs/assets/search.js b/docs/assets/search.js
index 00af0ae..1b9e928 100644
--- a/docs/assets/search.js
+++ b/docs/assets/search.js
@@ -1 +1 @@
-window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAE62YTW/jNhCG/8vkSiQeWv7SsVsE6GG3RRP0IhgLVaITofowJNrbheH/XlAWzaHJ2KycmyHP+86QfDgidYC2+dFBnBzgn6LOIeazOYM6rQTE8DWV2btogcGuLSGGopai3aSZ6J6Gvx7fZVUCg6xMu050EAMcmbbCCY/OXpUSvMi2qN9u+T30sZ2OJd4Mtmkraklq+yCdFNW2TKX4I5XvN/Pp4O0peFTCvuavQr43edj4Kh0bm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ZwjWwZO3LuHaEaxsAxQN62UEXHrygp8fHz48HIJsgVFyglyF0IUKbIlRsoJcjdEFCmyRUfKCXJXRhQpsmVIyglyd0gUKbKFScoJcpdKFCmypUrKCXK3TBQpssVLxg5BW7cKFNFypm0MsXuoChTRhXzHAvYdwljNuEcXxvR3AXMH7Rovoe5aWTe7qUDRhXyHB/h3MB4zZgXCHDvXRyFzBuA8YVMtxLJ3cBGx71Z8tBtFLkv53PmCSBi3vaEf4azp+1PuOOsIb4eDqZ0yY+nsiBo37r05Gbu7FZGptlmI2+UhkPRGOCGOTivlMTO1IThhXl3EiI25y4zQPd3GsVMZwRw1mQoe/mQgwXxHARZGi/iBkrzo0VD6ut0l8tjcvUmEw/4mGVgsQFP2CjP/QZJzLfHxiS/iBKKiIFBfno12oyv8SD80CTvWtDmORhK25fCcmgVmRUq49YDfc9YhURqyjIyn5FJwMka8bDNp3PBgnOGDbdep/9/VNdMJXYZ0zmP6y6y6+xxops3rCVtC/AZLCko2NYS3dvtmQJyP7jYfvPvbIaO8JGdJbzsE1k/7eA1EfKCzMin3mNDcE/gP4Ng12xE2VRC4iTzen0Px7cOmDRGQAA";
\ No newline at end of file
diff --git a/docs/classes/default.html b/docs/classes/default.html
index 5519007..8285d37 100644
--- a/docs/classes/default.html
+++ b/docs/classes/default.html
@@ -1,5 +1,5 @@
Collection of user-provided settings values set in plugin settings tab
-Register a command globally. Registered commands will be available from the @{link https://help.obsidian.md/Plugins/Command+palette Command palette}. The command id and name will be automatically prefixed with this plugin's id and name.
@@ -58,26 +59,26 @@ Not available on mobile.Determine if the given basename matches the provided matcher rule.
+Find the first Matcher instance in the user-provided settings that matches the given file.
+Find the first Matcher instance in the user-provided settings that matches the given file.
The Obsidian file object representing an existing note
The first Matcher whose rule matches the file, or undefined if no match is found
-Get the content of the template note at the provided path.
+Load this component and its children
+OptionalonOptionalonRegisters a callback to be called when unloading
@@ -110,18 +111,21 @@ This should not be needed unless your plugin registers commands dynamically. Supported formats are those provided by moment.js: https://momentjs.com/docs/#/displaying/format/The content to replace date variables in
The content with date variables replaced
-Replace any {{time}} or {{time:format}} variables in the content with the current time. +
Replace any {{time}} or {{time:format}} variables in the content with the current time. Supported formats are those provided by moment.js: https://momentjs.com/docs/#/displaying/format/
The content to replace time variables in
The content with time variables replaced
-Full path to a template note from the vault root
+Apply a template to a renamed note if the new name matches a user-provided rule.
+The Obsidian file object representing the renamed note
+The full path to the note from the vault root before it was renamed
+
TemplateByNoteNamePlugin is the main class that handles the plugin's lifecycle.
-