diff --git a/manifest.json b/manifest.json
index dec7270..14d6969 100644
--- a/manifest.json
+++ b/manifest.json
@@ -1,7 +1,7 @@
{
"id": "custom-sort",
"name": "Custom File Explorer sorting",
- "version": "1.6.0",
+ "version": "1.6.1",
"minAppVersion": "0.15.0",
"description": "Allows for manual and automatic, config-driven reordering and sorting of files and folders in File Explorer",
"author": "SebastianMC",
diff --git a/package.json b/package.json
index 7e26d61..e949c17 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "obsidian-custom-sort",
- "version": "1.6.0",
+ "version": "1.6.1",
"description": "Custom Sort plugin for Obsidian (https://obsidian.md)",
"main": "main.js",
"scripts": {
diff --git a/src/main.ts b/src/main.ts
index 5600446..2396c7c 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -6,6 +6,7 @@ import {
normalizePath,
Plugin,
PluginSettingTab,
+ sanitizeHTMLToDom,
setIcon,
Setting,
TAbstractFile,
@@ -86,12 +87,13 @@ export default class CustomSortPlugin extends Plugin {
// - the file(s) explicitly configured by user in plugin settings
// Be human-friendly and accept both .md and .md.md file extensions
// (the latter representing a typical confusion between note name vs underlying file name)
- if (aFile.name === SORTSPEC_FILE_NAME ||
- aFile.name === `${SORTSPEC_FILE_NAME}.md` ||
- aFile.basename === parent.name ||
- aFile.basename === this.settings.additionalSortspecFile ||
- aFile.path === this.settings.additionalSortspecFile ||
- aFile.path === `${this.settings.additionalSortspecFile}.md`
+ if (aFile.name === SORTSPEC_FILE_NAME || // file name == sortspec.md ?
+ aFile.name === `${SORTSPEC_FILE_NAME}.md` || // file name == sortspec.md.md ?
+ aFile.basename === parent.name || // Folder Note mode: inside folder, same name
+ aFile.basename === this.settings.additionalSortspecFile || // when user configured _about_
+ aFile.name === this.settings.additionalSortspecFile || // when user configured _about_.md
+ aFile.path === this.settings.additionalSortspecFile || // when user configured Inbox/sort.md
+ aFile.path === `${this.settings.additionalSortspecFile}.md` // when user configured Inbox/sort
) {
const sortingSpecTxt: string = mCache.getCache(aFile.path)?.frontmatter?.[SORTINGSPEC_YAML_KEY]
if (sortingSpecTxt) {
@@ -390,11 +392,26 @@ class CustomSortSettingTab extends PluginSettingTab {
containerEl.createEl('h2', {text: 'Settings for Custom File Explorer Sorting Plugin'});
+ const additionalSortspecFileDescr: DocumentFragment = sanitizeHTMLToDom(
+ 'A note name or note path to scan (YAML frontmatter) for sorting specification in addition to the `sortspec` notes and Folder Notes*.'
+ + '
'
+ + ' The `.md` filename suffix is optional.'
+ + '
(*) if you employ the Index-File based approach to folder notes (as documented in '
+ + 'Aidenlx Folder Note preferences'
+ + ') you can enter here the index note name, e.g. _about_'
+ + '
'
+ + 'The Inside Folder, with Same Name Recommended mode of Folder Notes is handled automatically, no additional configuration needed.'
+ + '
NOTE: After updating this setting remember to refresh the custom sorting via clicking on the ribbon icon or via the sort-on command' + + ' or by restarting Obsidian or reloading the vault
' + ) + new Setting(containerEl) - .setName('Path to the designated note containing sorting specification') - .setDesc('The YAML front matter of this note will be scanned for sorting specification, in addition to the `sortspec` notes and folder notes. The `.md` filename suffix is optional.') + .setName('Path or name of additional note(s) containing sorting specification') + .setDesc(additionalSortspecFileDescr) .addText(text => text - .setPlaceholder('e.g. Inbox/sort') + .setPlaceholder('e.g. _about_') .setValue(this.plugin.settings.additionalSortspecFile) .onChange(async (value) => { this.plugin.settings.additionalSortspecFile = value.trim() ? normalizePath(value) : ''; diff --git a/versions.json b/versions.json index 8c85121..6c80236 100644 --- a/versions.json +++ b/versions.json @@ -21,5 +21,6 @@ "1.3.0": "0.15.0", "1.4.0": "0.15.0", "1.5.0": "0.15.0", - "1.6.0": "0.15.0" + "1.6.0": "0.15.0", + "1.6.1": "0.15.0" }