mirror of
https://github.com/jxpeng98/obsidian-to-NotionNext
synced 2026-07-31 01:48:35 +08:00
feat: add auto sync frontmatter key configuration and update related messages
This commit is contained in:
@@ -2,7 +2,7 @@ import { App, Notice, TFile } from "obsidian";
|
||||
import ObsidianSyncNotionPlugin from "../main";
|
||||
import { DatabaseDetails } from "../ui/settingTabs";
|
||||
import { i18nConfig } from "src/lang/I18n";
|
||||
import { AUTO_SYNC_DATABASE_KEY, ensureAutoSyncDatabaseEntry } from "src/utils/frontmatter";
|
||||
import { ensureAutoSyncDatabaseEntry } from "src/utils/frontmatter";
|
||||
|
||||
export async function updateYamlInfo(
|
||||
yamlContent: string,
|
||||
@@ -18,6 +18,7 @@ export async function updateYamlInfo(
|
||||
const { abName } = dbDetails
|
||||
const notionIDKey = `NotionID-${abName}`;
|
||||
const linkKey = `link-${abName}`;
|
||||
const autoSyncKey = plugin.getAutoSyncFrontmatterKey();
|
||||
|
||||
if (notionUser !== "") {
|
||||
// replace url str "www" to notionID
|
||||
@@ -36,8 +37,8 @@ export async function updateYamlInfo(
|
||||
(NotionLinkDisplay) ? yamlContent[linkKey] = url : null;
|
||||
|
||||
// ensure auto sync database list contains current short name
|
||||
yamlContent[AUTO_SYNC_DATABASE_KEY] = ensureAutoSyncDatabaseEntry(
|
||||
yamlContent[AUTO_SYNC_DATABASE_KEY],
|
||||
yamlContent[autoSyncKey] = ensureAutoSyncDatabaseEntry(
|
||||
yamlContent[autoSyncKey],
|
||||
abName
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user