diff --git a/.gitignore b/.gitignore index e09a007..c344413 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,4 @@ data.json # Exclude macOS Finder (System Explorer) View States .DS_Store +.history \ No newline at end of file diff --git a/README-zh.md b/README-zh.md index 4518945..024a76f 100644 --- a/README-zh.md +++ b/README-zh.md @@ -86,6 +86,10 @@ Notion ID是你想分享文件的页面ID。 如果你不写它,notion将分享到默认的链接,如:https://www.notion.so/myworkspace/a8aec43384f447ed84390,访问这个页面将重定向到你的网站页面。 如果你写了Notion ID,它将分享到页面链接如:https://your_user_name.notion.site/myworkspace/a8aec43384f447ed84390。不需要重定向网址。 +## 同步图片 + +使用 [Obsidian Image Auto Upload Plugin](https://github.com/renmu123/obsidian-image-auto-upload-plugin) 插件,配置你自己的 cos 或者 oss,将图片存储到你自己的云存储,然后在 obsidian 中使用图片链接即可。该插件会自动帮你上传图片,并替换成链接。 + # 请我喝杯咖啡 [顿顿饭](https://dun.mianbaoduo.com/@easy) diff --git a/README.md b/README.md index aff75bb..51094e8 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,9 @@ if you write the Notion ID, it will share to the page link like: https://your_user_name.notion.site/myworkspace/a8aec43384f447ed84390. The visiter don't need to redirect url. +## Sync image to Notion + +To sync images to your oss or cos bucket, use the [Obsidian Image Auto Upload Plugin](https://github.com/renmu123/obsidian-image-auto-upload-plugin). # Buy me a cup of coffee. diff --git a/Upload2Notion.ts b/Upload2Notion.ts index 0c85cc7..b0f2101 100644 --- a/Upload2Notion.ts +++ b/Upload2Notion.ts @@ -125,9 +125,6 @@ export class Upload2Notion { // if __content have start \n remove it const __content_remove_n = __content.replace(/^\n/, '') const content = '---\n' +yamlhead_remove_n +'\n---\n' + __content_remove_n; - // const fullPath = this.getFilePath(nowFile); - //write content fo file - // fs.writeFileSync(fullPath, content); try { await nowFile.vault.modify(nowFile, content) } catch (error) {