From e99f6b29a1d84e6849f918d954cae24c6a339d9f Mon Sep 17 00:00:00 2001 From: nan Date: Wed, 22 Apr 2026 20:36:30 +0800 Subject: [PATCH] refactor: Rename 'nestNoteFolder' to 'nestInFolder' for consistency in settings --- src/main.ts | 8 ++++---- src/settings.ts | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main.ts b/src/main.ts index dfa2d8e..4ed4d96 100644 --- a/src/main.ts +++ b/src/main.ts @@ -109,13 +109,13 @@ export default class odoxPlugin extends Plugin { const fileNameWithoutExt = file.name.replace('.md', ''); const filePathWithoutExt = file.path.replace('.md', ''); - if (this.settings.preserveFolderStructure && this.settings.nestNoteFolder) { + if (this.settings.preserveFolderStructure && this.settings.nestInFolder) { // 保留文件夹 + 嵌套: notes/some-note.md > docs/notes/some-note/index.md docsPath = `${this.settings.docsPath}/${filePathWithoutExt}/index.md`; } else if (this.settings.preserveFolderStructure) { // 保留文件夹结构: notes/some-note.md > docs/notes/some-note.md docsPath = `${this.settings.docsPath}/${file.path}`; - } else if (this.settings.nestNoteFolder) { + } else if (this.settings.nestInFolder) { // 嵌套文件夹: notes/some-note.md > docs/some-note/index.md docsPath = `${this.settings.docsPath}/${fileNameWithoutExt}/index.md`; } else { @@ -161,13 +161,13 @@ export default class odoxPlugin extends Plugin { const filePathWithoutExt = file.path.replace('.canvas', ''); let docsPath: string; - if (this.settings.preserveFolderStructure && this.settings.nestNoteFolder) { + if (this.settings.preserveFolderStructure && this.settings.nestInFolder) { // 保留文件夹 + 嵌套: notes/some-note.canvas > docs/notes/some-note.canvas/index.md docsPath = `${this.settings.docsPath}/${filePathWithoutExt}.canvas/index.md`; } else if (this.settings.preserveFolderStructure) { // 保留文件夹结构: notes/some-note.canvas > docs/notes/some-note.canvas.md docsPath = `${this.settings.docsPath}/${filePathWithoutExt}.md`; - } else if (this.settings.nestNoteFolder) { + } else if (this.settings.nestInFolder) { // 嵌套文件夹: notes/some-note.canvas > docs/some-note.canvas/index.md docsPath = `${this.settings.docsPath}/${fileNameWithoutExt}.canvas/index.md`; } else { diff --git a/src/settings.ts b/src/settings.ts index 4dafb46..7d64323 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -4,7 +4,7 @@ import odoxPlugin from "./main"; export interface odoxSettings { docsPath: string; assetsPath: string; - nestNoteFolder: boolean; + nestInFolder: boolean; preserveFolderStructure: boolean; transparentCanvas: boolean; canvasEmbedTemplate: string; @@ -13,8 +13,8 @@ export interface odoxSettings { export const DEFAULT_SETTINGS: odoxSettings = { docsPath: 'docs', assetsPath: 'docs/public', - nestNoteFolder: true, - preserveFolderStructure: true, + nestInFolder: false, + preserveFolderStructure: false, transparentCanvas: true, canvasEmbedTemplate: '![]({url})' } @@ -34,7 +34,7 @@ export class odoxSettingTab extends PluginSettingTab { containerEl.empty(); new Setting(containerEl) - .setName('Wiki path') + .setName('Docs path') .setDesc('Path to the docs directory (relative to vault root)') .addText(text => text // eslint-disable-next-line @@ -61,9 +61,9 @@ export class odoxSettingTab extends PluginSettingTab { .setName('Nest note folder') .setDesc('Create a folder for each note (e.g., notes/some-note.md > docs/some-note/index.md)') .addToggle(toggle => toggle - .setValue(this.plugin.settings.nestNoteFolder) + .setValue(this.plugin.settings.nestInFolder) .onChange(async (value) => { - this.plugin.settings.nestNoteFolder = value; + this.plugin.settings.nestInFolder = value; await this.plugin.saveSettings(); }));