Explorar o código

:art: `新建文档名模板` 改为 `新建文档存放位置` 并支持设置路径 https://github.com/siyuan-note/siyuan/issues/4494

Liang Ding %!s(int64=2) %!d(string=hai) anos
pai
achega
551cbb8c18

+ 3 - 3
app/appearance/langs/en_US.json

@@ -655,14 +655,14 @@
   "fileTree3": "No confirmation required when deleting documents",
   "fileTree3": "No confirmation required when deleting documents",
   "fileTree4": "If not enabled, a confirmation box will pop up every time you delete a document",
   "fileTree4": "If not enabled, a confirmation box will pop up every time you delete a document",
   "fileTree5": "Ref create doc save location",
   "fileTree5": "Ref create doc save location",
-  "fileTree6": "When using <code class='fn__code'>((</code>, the save path of the new document (for example, <code class='fn__code'>/folder1/{{now | date \"20060102150405\"}}/</code>, the relative path of the current doc is used if it does not start with /)",
+  "fileTree6": "When using <code class='fn__code'>((</code>, the save path of the new document (for example, <code class='fn__code'>/folder1/{{now | date \"20060102150405\"}}/</code>, the relative path of the current doc is used if it does not start with <code class='fn__code'>/</code>)",
   "fileTree7": "Open in the current tab",
   "fileTree7": "Open in the current tab",
   "fileTree8": "The newly opened document tab will replace the unmodified tab",
   "fileTree8": "The newly opened document tab will replace the unmodified tab",
   "fileTree9": "Close all tabs at startup",
   "fileTree9": "Close all tabs at startup",
   "fileTree10": "After enabling, the unpinned tabs that were opened the last time will be automatically closed every time the interface is started",
   "fileTree10": "After enabling, the unpinned tabs that were opened the last time will be automatically closed every time the interface is started",
   "fileTree11": "New daily note",
   "fileTree11": "New daily note",
-  "fileTree12": "New doc name template",
-  "fileTree13": "The template snippet is used by default when creating a new doc for naming (for example <code class='fn__code'>{{now | date \"20060102150405\"}}</code>)",
+  "fileTree12": "New document save location",
+  "fileTree13": "When using <code class='fn__code'>Ctrl+N</code>, the save path of the new document (for example, <code class='fn__code'>/folder1/{{now | date \"20060102150405\"}}</code>)",
   "fileTree14": "Save path (support date format template variables, such as <code class='fn__code'>/Daily Notes/{{now | date \"2006/01\"}}/{{now | date \"2006-01-02\"}}</code>)",
   "fileTree14": "Save path (support date format template variables, such as <code class='fn__code'>/Daily Notes/{{now | date \"2006/01\"}}/{{now | date \"2006-01-02\"}}</code>)",
   "fileTree15": "Template path (for example, <code class='fn__code'>dailynote.md</code>, the file needs to be placed under the workspace/data/templates/)",
   "fileTree15": "Template path (for example, <code class='fn__code'>dailynote.md</code>, the file needs to be placed under the workspace/data/templates/)",
   "fileTree16": "Maximum number to list",
   "fileTree16": "Maximum number to list",

+ 3 - 3
app/appearance/langs/es_ES.json

@@ -655,14 +655,14 @@
   "fileTree3": "No se requiere confirmación al borrar documentos",
   "fileTree3": "No se requiere confirmación al borrar documentos",
   "fileTree4": "Si no se activa, aparecerá un cuadro de confirmación cada vez que se elimine un documento",
   "fileTree4": "Si no se activa, aparecerá un cuadro de confirmación cada vez que se elimine un documento",
   "fileTree5": "Ref crear ubicación de guardado de documentos",
   "fileTree5": "Ref crear ubicación de guardado de documentos",
-  "fileTree6": "Al utilizar <code class='fn__code'>((</code>, la ruta de guardado del nuevo documento (por ejemplo, <code class='fn__code'>/carpeta1/{{now | date \"20060102150405\"}}/</code>, se utiliza la ruta relativa del documento actual si no empieza por /)",
+  "fileTree6": "Al utilizar <code class='fn__code'>((</code>, la ruta de guardado del nuevo documento (por ejemplo, <code class='fn__code'>/carpeta1/{{now | date \"20060102150405\"}}/</code>, se utiliza la ruta relativa del documento actual si no empieza por <code class='fn__code'>/</code>)",
   "fileTree7": "Abrir en la pestaña actual",
   "fileTree7": "Abrir en la pestaña actual",
   "fileTree8": "La pestaña del documento recién abierto sustituirá a la pestaña no modificada",
   "fileTree8": "La pestaña del documento recién abierto sustituirá a la pestaña no modificada",
   "fileTree9": "Cerrar todas las pestañas al inicio",
   "fileTree9": "Cerrar todas las pestañas al inicio",
   "fileTree10": "Cuando está habilitado, las pestañas no fijadas que se abrieron la última vez se cerrarán automáticamente cada vez que se inicie la interfaz",
   "fileTree10": "Cuando está habilitado, las pestañas no fijadas que se abrieron la última vez se cerrarán automáticamente cada vez que se inicie la interfaz",
   "fileTree11": "Nueva nota diaria",
   "fileTree11": "Nueva nota diaria",
-  "fileTree12": "Nueva pantilla de nombre de documento",
-  "fileTree13": "El fragmento de plantilla se utiliza por defecto cuando se crea un nuevo documento para nombrar (por ejemplo <code class='fn__code'>{{now | date \"20060102150405\"}}</code>)",
+  "fileTree12": "Nueva ubicación para guardar el documento",
+  "fileTree13": "Al usar <code class='fn__code'>Ctrl+N</code>, la ruta de guardado del nuevo documento (por ejemplo, <code class='fn__code'>/folder1/{{now | date \"20060102150405\"}}</código>)",
   "fileTree14": "Ruta de guardado (admite variables de plantilla de formato de fecha, como <code class='fn__code'>/Notas del día/{{now | date \"2006/01\"}}/{{now | date \"2006-01-02\"}}</code>)",
   "fileTree14": "Ruta de guardado (admite variables de plantilla de formato de fecha, como <code class='fn__code'>/Notas del día/{{now | date \"2006/01\"}}/{{now | date \"2006-01-02\"}}</code>)",
   "fileTree15": "Ruta de la plantilla (por ejemplo, <code class='fn__code'>dailynote.md</code>, el archivo debe colocarse en el espacio de trabajo/data/templates/)",
   "fileTree15": "Ruta de la plantilla (por ejemplo, <code class='fn__code'>dailynote.md</code>, el archivo debe colocarse en el espacio de trabajo/data/templates/)",
   "fileTree16": "Número máximo a listar",
   "fileTree16": "Número máximo a listar",

+ 3 - 3
app/appearance/langs/fr_FR.json

@@ -655,14 +655,14 @@
   "fileTree3": "Aucune confirmation requise lors de la suppression de documents",
   "fileTree3": "Aucune confirmation requise lors de la suppression de documents",
   "fileTree4": "Si non activé, une boîte de confirmation apparaîtra à chaque fois que vous supprimerez un document",
   "fileTree4": "Si non activé, une boîte de confirmation apparaîtra à chaque fois que vous supprimerez un document",
   "fileTree5": "Référence créer doc enregistrer emplacement",
   "fileTree5": "Référence créer doc enregistrer emplacement",
-  "fileTree6": "Lors de l'utilisation de <code class='fn__code'>((</code>, le chemin d'enregistrement du nouveau document (par exemple, <code class='fn__code'>/dossier1/{{now | date \"20060102150405\"}}/</code>, le chemin relatif du doc actuel est utilisé s'il ne commence pas par /).",
+  "fileTree6": "Lors de l'utilisation de <code class='fn__code'>((</code>, le chemin d'enregistrement du nouveau document (par exemple, <code class='fn__code'>/dossier1/{{now | date \"20060102150405\"}}/</code>, le chemin relatif du doc actuel est utilisé s'il ne commence pas par <code class='fn__code'>/</code>).",
   "fileTree7": "Ouvrir dans l'Onglet actuel",
   "fileTree7": "Ouvrir dans l'Onglet actuel",
   "fileTree8": "L'onglet du document nouvellement ouvert remplacera l'Onglet non modifié.",
   "fileTree8": "L'onglet du document nouvellement ouvert remplacera l'Onglet non modifié.",
   "fileTree9": "Fermer tous les onglets au démarrage",
   "fileTree9": "Fermer tous les onglets au démarrage",
   "fileTree10": "Lorsqu'il est activé, les onglets non épinglés qui ont été ouverts la dernière fois seront automatiquement fermés à chaque démarrage de l'interface",
   "fileTree10": "Lorsqu'il est activé, les onglets non épinglés qui ont été ouverts la dernière fois seront automatiquement fermés à chaque démarrage de l'interface",
   "fileTree11": "Nouvelle note quotidienne",
   "fileTree11": "Nouvelle note quotidienne",
-  "fileTree12": "Nouveau template de nom de document",
-  "fileTree13": "L'extrait de modèle est utilisé par défaut lors de la création d'un nouveau document pour le nommage (par exemple <code class='fn__code'>{{maintenant | date \"20060102150405\"}}</code>).",
+  "fileTree12": "Emplacement de sauvegarde du nouveau document",
+  "fileTree13": "Lorsque vous utilisez <code class='fn__code'>Ctrl+N</code>, le chemin d'enregistrement du nouveau document (par exemple, <code class='fn__code'>/folder1/{{now | date \"20060102150405\"}}</code>)",
   "fileTree14": "Chemin d'enregistrement (prise en charge des variables de modèle de format de date, telles que <code class='fn__code'>/Notes quotidiennes/{{mais | date \"2006/01\"}}/{{mais | date \"2006-01-02\"}}</code>)",
   "fileTree14": "Chemin d'enregistrement (prise en charge des variables de modèle de format de date, telles que <code class='fn__code'>/Notes quotidiennes/{{mais | date \"2006/01\"}}/{{mais | date \"2006-01-02\"}}</code>)",
   "fileTree15": "Chemin du modèle (par exemple, <code class='fn__code'>dailynote.md</code>, le fichier doit être placé sous \"l'espace de travail/data/templates/\")",
   "fileTree15": "Chemin du modèle (par exemple, <code class='fn__code'>dailynote.md</code>, le fichier doit être placé sous \"l'espace de travail/data/templates/\")",
   "fileTree16": "Nombre maximum à lister",
   "fileTree16": "Nombre maximum à lister",

+ 3 - 3
app/appearance/langs/zh_CHT.json

@@ -655,14 +655,14 @@
   "fileTree3": "刪除文檔時不需要確認",
   "fileTree3": "刪除文檔時不需要確認",
   "fileTree4": "不啟用時每次刪除文檔都會彈出確認框",
   "fileTree4": "不啟用時每次刪除文檔都會彈出確認框",
   "fileTree5": "塊引新建文檔存放位置",
   "fileTree5": "塊引新建文檔存放位置",
-  "fileTree6": "使用 <code class='fn__code'>((</code> 時新建文檔的存放路徑(例如 <code class='fn__code'>/folder1/{{now | date \"20060102150405\"}}/</code>,不以 / 開頭則使用當前文檔相對路徑)",
+  "fileTree6": "使用 <code class='fn__code'>((</code> 時新建文檔的存放路徑(例如 <code class='fn__code'>/folder1/{{now | date \"20060102150405\"}}/</code>,不以 <code class='fn__code'>/</code> 開頭則使用當前文檔相對路徑)",
   "fileTree7": "在當前分頁中打開",
   "fileTree7": "在當前分頁中打開",
   "fileTree8": "新打開的文檔分頁將會替換沒有修改過的分頁",
   "fileTree8": "新打開的文檔分頁將會替換沒有修改過的分頁",
   "fileTree9": "啟動時關閉所有頁籤",
   "fileTree9": "啟動時關閉所有頁籤",
   "fileTree10": "啟用後每次啟動界面後都會自動關閉上次打開未釘住的頁籤",
   "fileTree10": "啟用後每次啟動界面後都會自動關閉上次打開未釘住的頁籤",
   "fileTree11": "新建日記",
   "fileTree11": "新建日記",
-  "fileTree12": "新建文檔名範本",
-  "fileTree13": "使用該範本片段進行命名(例如<code class='fn__code'>{{now | date \"20060102150405\"}}</code>)",
+  "fileTree12": "新建文檔存放位置",
+  "fileTree13": "使用 <code class='fn__code'>Ctrl+N</code> 時新建文檔的存放路徑(例如 <code class='fn__code'>/folder1/{{now | date \"20060102150405\"}}</code>)",
   "fileTree14": "存放路徑(可使用日期格式範本變數,例如 <code class='fn__code'>/日記/{{now | date \"2006/01\"}}/{{now | date \"2006-01-02\"}}</code>)",
   "fileTree14": "存放路徑(可使用日期格式範本變數,例如 <code class='fn__code'>/日記/{{now | date \"2006/01\"}}/{{now | date \"2006-01-02\"}}</code>)",
   "fileTree15": "範本路徑(例如 <code class='fn__code'>dailynote.md</code>,需要將該檔放置於工作空間/data/templates/ 下)",
   "fileTree15": "範本路徑(例如 <code class='fn__code'>dailynote.md</code>,需要將該檔放置於工作空間/data/templates/ 下)",
   "fileTree16": "最大列出數量",
   "fileTree16": "最大列出數量",

+ 3 - 3
app/appearance/langs/zh_CN.json

@@ -655,14 +655,14 @@
   "fileTree3": "删除文档时不需要确认",
   "fileTree3": "删除文档时不需要确认",
   "fileTree4": "不启用时每次删除文档都会弹出确认框",
   "fileTree4": "不启用时每次删除文档都会弹出确认框",
   "fileTree5": "块引新建文档存放位置",
   "fileTree5": "块引新建文档存放位置",
-  "fileTree6": "使用 <code class='fn__code'>((</code> 时新建文档的存放路径(例如 <code class='fn__code'>/folder1/{{now | date \"20060102150405\"}}/</code>,不以 / 开头则使用当前文档相对路径)",
+  "fileTree6": "使用 <code class='fn__code'>((</code> 时新建文档的存放路径(例如 <code class='fn__code'>/folder1/{{now | date \"20060102150405\"}}/</code>,不以 <code class='fn__code'>/</code> 开头则使用当前文档相对路径)",
   "fileTree7": "在当前页签中打开",
   "fileTree7": "在当前页签中打开",
   "fileTree8": "新打开的文档页签将会替换没有修改过的页签",
   "fileTree8": "新打开的文档页签将会替换没有修改过的页签",
   "fileTree9": "启动时关闭所有页签",
   "fileTree9": "启动时关闭所有页签",
   "fileTree10": "启用后每次启动界面后都会自动关闭上次打开未钉住的页签",
   "fileTree10": "启用后每次启动界面后都会自动关闭上次打开未钉住的页签",
   "fileTree11": "新建日记",
   "fileTree11": "新建日记",
-  "fileTree12": "新建文档名模板",
-  "fileTree13": "使用该模板片段进行命名(例如 <code class='fn__code'>{{now | date \"20060102150405\"}}</code>)",
+  "fileTree12": "新建文档存放位置",
+  "fileTree13": "使用 <code class='fn__code'>Ctrl+N</code> 时新建文档的存放路径(例如 <code class='fn__code'>/folder1/{{now | date \"20060102150405\"}}</code>)",
   "fileTree14": "存放路径(可使用日期格式模板变量,例如 <code class='fn__code'>/日记/{{now | date \"2006/01\"}}/{{now | date \"2006-01-02\"}}</code>)",
   "fileTree14": "存放路径(可使用日期格式模板变量,例如 <code class='fn__code'>/日记/{{now | date \"2006/01\"}}/{{now | date \"2006-01-02\"}}</code>)",
   "fileTree15": "模板路径(例如 <code class='fn__code'>dailynote.md</code>,需要将该文件放置于工作空间/data/templates/ 下)",
   "fileTree15": "模板路径(例如 <code class='fn__code'>dailynote.md</code>,需要将该文件放置于工作空间/data/templates/ 下)",
   "fileTree16": "最大列出数量",
   "fileTree16": "最大列出数量",

+ 3 - 3
app/src/config/fileTree.ts

@@ -49,7 +49,7 @@ export const fileTree = {
         <div class="b3-label__text">${window.siyuan.languages.fileTree13}</div>
         <div class="b3-label__text">${window.siyuan.languages.fileTree13}</div>
     </div>
     </div>
     <span class="fn__space"></span>
     <span class="fn__space"></span>
-    <input class="b3-text-field fn__flex-center fn__size200" id="createDocNameTemplate" value="">
+    <input class="b3-text-field fn__flex-center fn__size200" id="docCreateSavePath" value="">
 </label>
 </label>
 <label class="b3-label fn__flex config__item">
 <label class="b3-label fn__flex config__item">
     <div class="fn__flex-1">
     <div class="fn__flex-1">
@@ -92,7 +92,7 @@ export const fileTree = {
             sort: window.siyuan.config.fileTree.sort,
             sort: window.siyuan.config.fileTree.sort,
             alwaysSelectOpenedFile: (fileTree.element.querySelector("#alwaysSelectOpenedFile") as HTMLInputElement).checked,
             alwaysSelectOpenedFile: (fileTree.element.querySelector("#alwaysSelectOpenedFile") as HTMLInputElement).checked,
             refCreateSavePath: (fileTree.element.querySelector("#refCreateSavePath") as HTMLInputElement).value,
             refCreateSavePath: (fileTree.element.querySelector("#refCreateSavePath") as HTMLInputElement).value,
-            createDocNameTemplate: (fileTree.element.querySelector("#createDocNameTemplate") as HTMLInputElement).value,
+            docCreateSavePath: (fileTree.element.querySelector("#docCreateSavePath") as HTMLInputElement).value,
             openFilesUseCurrentTab: (fileTree.element.querySelector("#openFilesUseCurrentTab") as HTMLInputElement).checked,
             openFilesUseCurrentTab: (fileTree.element.querySelector("#openFilesUseCurrentTab") as HTMLInputElement).checked,
             closeTabsOnStart: (fileTree.element.querySelector("#closeTabsOnStart") as HTMLInputElement).checked,
             closeTabsOnStart: (fileTree.element.querySelector("#closeTabsOnStart") as HTMLInputElement).checked,
             allowCreateDeeper: (fileTree.element.querySelector("#allowCreateDeeper") as HTMLInputElement).checked,
             allowCreateDeeper: (fileTree.element.querySelector("#allowCreateDeeper") as HTMLInputElement).checked,
@@ -104,7 +104,7 @@ export const fileTree = {
         });
         });
     },
     },
     bindEvent: () => {
     bindEvent: () => {
-        (fileTree.element.querySelector("#createDocNameTemplate") as HTMLInputElement).value = window.siyuan.config.fileTree.createDocNameTemplate;
+        (fileTree.element.querySelector("#docCreateSavePath") as HTMLInputElement).value = window.siyuan.config.fileTree.docCreateSavePath;
         (fileTree.element.querySelector("#refCreateSavePath") as HTMLInputElement).value = window.siyuan.config.fileTree.refCreateSavePath;
         (fileTree.element.querySelector("#refCreateSavePath") as HTMLInputElement).value = window.siyuan.config.fileTree.refCreateSavePath;
         fileTree.element.querySelectorAll("input").forEach((item) => {
         fileTree.element.querySelectorAll("input").forEach((item) => {
             item.addEventListener("change", () => {
             item.addEventListener("change", () => {

+ 1 - 1
app/src/layout/dock/Files.ts

@@ -950,7 +950,7 @@ class="b3-list-item b3-list-item--hide-action" data-path="${item.path}">
                 sort: window.siyuan.config.fileTree.sort,
                 sort: window.siyuan.config.fileTree.sort,
                 alwaysSelectOpenedFile: window.siyuan.config.fileTree.alwaysSelectOpenedFile,
                 alwaysSelectOpenedFile: window.siyuan.config.fileTree.alwaysSelectOpenedFile,
                 refCreateSavePath: window.siyuan.config.fileTree.refCreateSavePath,
                 refCreateSavePath: window.siyuan.config.fileTree.refCreateSavePath,
-                createDocNameTemplate: window.siyuan.config.fileTree.createDocNameTemplate,
+                docCreateSavePath: window.siyuan.config.fileTree.docCreateSavePath,
                 openFilesUseCurrentTab: window.siyuan.config.fileTree.openFilesUseCurrentTab,
                 openFilesUseCurrentTab: window.siyuan.config.fileTree.openFilesUseCurrentTab,
                 maxListCount: window.siyuan.config.fileTree.maxListCount,
                 maxListCount: window.siyuan.config.fileTree.maxListCount,
             }, () => {
             }, () => {

+ 5 - 5
app/src/menus/onGetnotebookconf.ts

@@ -10,7 +10,7 @@ export const onGetnotebookconf = (data: {
     box: string,
     box: string,
     conf: {
     conf: {
         refCreateSavePath: string
         refCreateSavePath: string
-        createDocNameTemplate: string
+        docCreateSavePath: string
         dailyNoteSavePath: string
         dailyNoteSavePath: string
         dailyNoteTemplatePath: string
         dailyNoteTemplatePath: string
     }
     }
@@ -24,7 +24,7 @@ export const onGetnotebookconf = (data: {
     <div class="fn__hr"></div>
     <div class="fn__hr"></div>
     <div class="b3-label__text">${window.siyuan.languages.fileTree13}</div>
     <div class="b3-label__text">${window.siyuan.languages.fileTree13}</div>
     <div class="fn__hr"></div>
     <div class="fn__hr"></div>
-    <input class="b3-text-field fn__flex-center fn__block" id="createDocNameTemplate" value="">
+    <input class="b3-text-field fn__flex-center fn__block" id="docCreateSavePath" value="">
 </div>
 </div>
 <div class="b3-label">
 <div class="b3-label">
     ${window.siyuan.languages.fileTree5}
     ${window.siyuan.languages.fileTree5}
@@ -65,8 +65,8 @@ export const onGetnotebookconf = (data: {
     });
     });
     const dailyNoteSavePathElement = contentElement.querySelector("#dailyNoteSavePath") as HTMLInputElement;
     const dailyNoteSavePathElement = contentElement.querySelector("#dailyNoteSavePath") as HTMLInputElement;
     dailyNoteSavePathElement.value = data.conf.dailyNoteSavePath;
     dailyNoteSavePathElement.value = data.conf.dailyNoteSavePath;
-    const createDocNameTemplateElement = contentElement.querySelector("#createDocNameTemplate") as HTMLInputElement;
-    createDocNameTemplateElement.value = data.conf.createDocNameTemplate;
+    const docCreateSavePathElement = contentElement.querySelector("#docCreateSavePath") as HTMLInputElement;
+    docCreateSavePathElement.value = data.conf.docCreateSavePath;
     const refCreateSavePathElement = contentElement.querySelector("#refCreateSavePath") as HTMLInputElement;
     const refCreateSavePathElement = contentElement.querySelector("#refCreateSavePath") as HTMLInputElement;
     refCreateSavePathElement.value = data.conf.refCreateSavePath;
     refCreateSavePathElement.value = data.conf.refCreateSavePath;
     const dailyNoteTemplatePathElement = contentElement.querySelector("#dailyNoteTemplatePath") as HTMLInputElement;
     const dailyNoteTemplatePathElement = contentElement.querySelector("#dailyNoteTemplatePath") as HTMLInputElement;
@@ -77,7 +77,7 @@ export const onGetnotebookconf = (data: {
                 notebook: data.box,
                 notebook: data.box,
                 conf: {
                 conf: {
                     refCreateSavePath: refCreateSavePathElement.value,
                     refCreateSavePath: refCreateSavePathElement.value,
-                    createDocNameTemplate: createDocNameTemplateElement.value,
+                    docCreateSavePath: docCreateSavePathElement.value,
                     dailyNoteSavePath: dailyNoteSavePathElement.value,
                     dailyNoteSavePath: dailyNoteSavePathElement.value,
                     dailyNoteTemplatePath: dailyNoteTemplatePathElement.value,
                     dailyNoteTemplatePath: dailyNoteTemplatePathElement.value,
                 }
                 }

+ 1 - 1
app/src/mobile/util/MobileFiles.ts

@@ -219,7 +219,7 @@ export class MobileFiles extends Model {
                 sort: window.siyuan.config.fileTree.sort,
                 sort: window.siyuan.config.fileTree.sort,
                 alwaysSelectOpenedFile: window.siyuan.config.fileTree.alwaysSelectOpenedFile,
                 alwaysSelectOpenedFile: window.siyuan.config.fileTree.alwaysSelectOpenedFile,
                 refCreateSavePath: window.siyuan.config.fileTree.refCreateSavePath,
                 refCreateSavePath: window.siyuan.config.fileTree.refCreateSavePath,
-                createDocNameTemplate: window.siyuan.config.fileTree.createDocNameTemplate,
+                docCreateSavePath: window.siyuan.config.fileTree.docCreateSavePath,
                 openFilesUseCurrentTab: window.siyuan.config.fileTree.openFilesUseCurrentTab,
                 openFilesUseCurrentTab: window.siyuan.config.fileTree.openFilesUseCurrentTab,
                 maxListCount: window.siyuan.config.fileTree.maxListCount,
                 maxListCount: window.siyuan.config.fileTree.maxListCount,
             }, () => {
             }, () => {

+ 1 - 1
app/src/types/index.d.ts

@@ -361,7 +361,7 @@ declare interface IFileTree {
     removeDocWithoutConfirm: boolean
     removeDocWithoutConfirm: boolean
     allowCreateDeeper: boolean
     allowCreateDeeper: boolean
     refCreateSavePath: string
     refCreateSavePath: string
-    createDocNameTemplate: string
+    docCreateSavePath: string
     sort: number
     sort: number
     maxOpenTabCount: number
     maxOpenTabCount: number
     maxListCount: number
     maxListCount: number

+ 7 - 7
kernel/api/filetree.go

@@ -517,7 +517,7 @@ func lockFile(c *gin.Context) {
 	}
 	}
 }
 }
 
 
-func getDocNameTemplate(c *gin.Context) {
+func getDocCreateSavePath(c *gin.Context) {
 	ret := gulu.Ret.NewResult()
 	ret := gulu.Ret.NewResult()
 	defer c.JSON(http.StatusOK, ret)
 	defer c.JSON(http.StatusOK, ret)
 
 
@@ -528,22 +528,22 @@ func getDocNameTemplate(c *gin.Context) {
 
 
 	notebook := arg["notebook"].(string)
 	notebook := arg["notebook"].(string)
 	box := model.Conf.Box(notebook)
 	box := model.Conf.Box(notebook)
-	nameTemplate := model.Conf.FileTree.CreateDocNameTemplate
+	docCreateSavePathTpl := model.Conf.FileTree.DocCreateSavePath
 	if nil != box {
 	if nil != box {
-		nameTemplate = box.GetConf().CreateDocNameTemplate
+		docCreateSavePathTpl = box.GetConf().DocCreateSavePath
 	}
 	}
-	if "" == nameTemplate {
-		nameTemplate = model.Conf.FileTree.CreateDocNameTemplate
+	if "" == docCreateSavePathTpl {
+		docCreateSavePathTpl = model.Conf.FileTree.DocCreateSavePath
 	}
 	}
 
 
-	name, err := model.RenderGoTemplate(nameTemplate)
+	path, err := model.RenderGoTemplate(docCreateSavePathTpl)
 	if nil != err {
 	if nil != err {
 		ret.Code = -1
 		ret.Code = -1
 		ret.Msg = err.Error()
 		ret.Msg = err.Error()
 		return
 		return
 	}
 	}
 	ret.Data = map[string]interface{}{
 	ret.Data = map[string]interface{}{
-		"name": name,
+		"path": path,
 	}
 	}
 }
 }
 
 

+ 1 - 1
kernel/api/router.go

@@ -86,7 +86,7 @@ func ServeAPI(ginServer *gin.Engine) {
 	ginServer.Handle("POST", "/api/filetree/searchDocs", model.CheckAuth, searchDocs)
 	ginServer.Handle("POST", "/api/filetree/searchDocs", model.CheckAuth, searchDocs)
 	ginServer.Handle("POST", "/api/filetree/listDocsByPath", model.CheckAuth, listDocsByPath)
 	ginServer.Handle("POST", "/api/filetree/listDocsByPath", model.CheckAuth, listDocsByPath)
 	ginServer.Handle("POST", "/api/filetree/getDoc", model.CheckAuth, getDoc)
 	ginServer.Handle("POST", "/api/filetree/getDoc", model.CheckAuth, getDoc)
-	ginServer.Handle("POST", "/api/filetree/getDocNameTemplate", model.CheckAuth, getDocNameTemplate)
+	ginServer.Handle("POST", "/api/filetree/getDocCreateSavePath", model.CheckAuth, getDocCreateSavePath)
 	ginServer.Handle("POST", "/api/filetree/getRefCreateSavePath", model.CheckAuth, getRefCreateSavePath)
 	ginServer.Handle("POST", "/api/filetree/getRefCreateSavePath", model.CheckAuth, getRefCreateSavePath)
 	ginServer.Handle("POST", "/api/filetree/changeSort", model.CheckAuth, changeSort)
 	ginServer.Handle("POST", "/api/filetree/changeSort", model.CheckAuth, changeSort)
 	ginServer.Handle("POST", "/api/filetree/lockFile", model.CheckAuth, lockFile)
 	ginServer.Handle("POST", "/api/filetree/lockFile", model.CheckAuth, lockFile)

+ 2 - 4
kernel/conf/box.go

@@ -22,8 +22,8 @@ type BoxConf struct {
 	Sort                  int    `json:"sort"`                  // 排序字段
 	Sort                  int    `json:"sort"`                  // 排序字段
 	Icon                  string `json:"icon"`                  // 图标
 	Icon                  string `json:"icon"`                  // 图标
 	Closed                bool   `json:"closed"`                // 是否处于关闭状态
 	Closed                bool   `json:"closed"`                // 是否处于关闭状态
-	RefCreateSavePath     string `json:"refCreateSavePath"`     // 块引时新建文档存储文件夹路径
-	CreateDocNameTemplate string `json:"createDocNameTemplate"` // 新建文档名模板
+	RefCreateSavePath     string `json:"refCreateSavePath"`     // 块引时新建文档存储路径
+	DocCreateSavePath     string `json:"docCreateSavePath"`     // 新建文档存储路径
 	DailyNoteSavePath     string `json:"dailyNoteSavePath"`     // 新建日记存储路径
 	DailyNoteSavePath     string `json:"dailyNoteSavePath"`     // 新建日记存储路径
 	DailyNoteTemplatePath string `json:"dailyNoteTemplatePath"` // 新建日记使用的模板路径
 	DailyNoteTemplatePath string `json:"dailyNoteTemplatePath"` // 新建日记使用的模板路径
 }
 }
@@ -32,8 +32,6 @@ func NewBoxConf() *BoxConf {
 	return &BoxConf{
 	return &BoxConf{
 		Name:                  "Untitled",
 		Name:                  "Untitled",
 		Closed:                true,
 		Closed:                true,
-		RefCreateSavePath:     "",
-		CreateDocNameTemplate: "",
 		DailyNoteSavePath:     "/daily note/{{now | date \"2006/01\"}}/{{now | date \"2006-01-02\"}}",
 		DailyNoteSavePath:     "/daily note/{{now | date \"2006/01\"}}/{{now | date \"2006-01-02\"}}",
 		DailyNoteTemplatePath: "",
 		DailyNoteTemplatePath: "",
 	}
 	}

+ 2 - 3
kernel/conf/filetree.go

@@ -23,8 +23,8 @@ import (
 type FileTree struct {
 type FileTree struct {
 	AlwaysSelectOpenedFile  bool   `json:"alwaysSelectOpenedFile"`  // 是否自动选中当前打开的文件
 	AlwaysSelectOpenedFile  bool   `json:"alwaysSelectOpenedFile"`  // 是否自动选中当前打开的文件
 	OpenFilesUseCurrentTab  bool   `json:"openFilesUseCurrentTab"`  // 在当前页签打开文件
 	OpenFilesUseCurrentTab  bool   `json:"openFilesUseCurrentTab"`  // 在当前页签打开文件
-	RefCreateSavePath       string `json:"refCreateSavePath"`       // 块引时新建文档存储文件夹路径
-	CreateDocNameTemplate   string `json:"createDocNameTemplate"`   // 新建文档名模板
+	RefCreateSavePath       string `json:"refCreateSavePath"`       // 块引时新建文档存储路径
+	DocCreateSavePath       string `json:"docCreateSavePath"`       // 新建文档存储路径
 	MaxListCount            int    `json:"maxListCount"`            // 最大列出数量
 	MaxListCount            int    `json:"maxListCount"`            // 最大列出数量
 	MaxOpenTabCount         int    `json:"maxOpenTabCount"`         // 最大打开页签数量
 	MaxOpenTabCount         int    `json:"maxOpenTabCount"`         // 最大打开页签数量
 	AllowCreateDeeper       bool   `json:"allowCreateDeeper"`       // 允许创建超过 7 层深度的子文档
 	AllowCreateDeeper       bool   `json:"allowCreateDeeper"`       // 允许创建超过 7 层深度的子文档
@@ -39,7 +39,6 @@ func NewFileTree() *FileTree {
 		AlwaysSelectOpenedFile: false,
 		AlwaysSelectOpenedFile: false,
 		OpenFilesUseCurrentTab: false,
 		OpenFilesUseCurrentTab: false,
 		Sort:                   util.SortModeCustom,
 		Sort:                   util.SortModeCustom,
-		CreateDocNameTemplate:  "",
 		MaxListCount:           512,
 		MaxListCount:           512,
 		MaxOpenTabCount:        8,
 		MaxOpenTabCount:        8,
 		AllowCreateDeeper:      false,
 		AllowCreateDeeper:      false,