diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 024ef23..efeb4f8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,7 +4,6 @@ on: push: branches: - "*" - - "!master" env: PLUGIN_NAME: share-to-notionnext # Change this to match the id of your plugin. diff --git a/README-zh.md b/README-zh.md index efb5382..1b68944 100644 --- a/README-zh.md +++ b/README-zh.md @@ -5,6 +5,17 @@ 所以我在[原作者](https://github.com/EasyChris/obsidian-to-notion)的基础之上,增加了匹配[NotionNext](https://github.com/tangly1024/NotionNext)模板的功能。这样可以直接在Obsidian编辑,整理好之后一键发布。 ## 更新说明 +### 1.1.2 +- 修复了一个拼写错误,导致无法同步`status`到NotionNext。现在你可以使用`stats`或者`status`来同步文章的状态到NotionNext。这个更新不会影响到同步到General数据库的功能。 +- **`stats`和`status`都可以使用,但是你只能使用其中一个。** + +```yaml +stats: Draft # Draft, Invisible, Published, default is Draft, 默认是Draft +# or +status: Draft # Draft, Invisible, Published, default is Draft, 默认是Draft +# both of them will work, but you can only use one of them. +``` + ### 1.1.1 - 修复了在日语系统下,无法显示设置按钮的错误。 - 增加日语翻译。 diff --git a/README.md b/README.md index f3c4fe6..e69c11e 100644 --- a/README.md +++ b/README.md @@ -45,8 +45,19 @@ Thus, based on the [original author's work](https://github.com/EasyChris/obsidia **Note: You need to add your previous database in the new template.** **注意:你需要将之前的数据库添加到新的模板中。** +### 1.1.2 +- Fix the typo that you cannot sync the markdown file `status` in the frontmatter to NotionNext. You can use `stats` or `status` to sync the status of the post to NotionNext. This update will not affect the function of syncing to General database. +- 修复了一个拼写错误,导致无法同步`status`到NotionNext。现在你可以使用`stats`或者`status`来同步文章的状态到NotionNext。这个更新不会影响到同步到General数据库的功能。 +- **Both `stats` and `status` will work, but you can only use one of them.** +- **`stats`和`status`都可以使用,但是你只能使用其中一个。** -### 1.2.0 +For example, +```yaml +stats: Draft # Draft, Invisible, Published, default is Draft, 默认是Draft +# or +status: Draft # Draft, Invisible, Published, default is Draft, 默认是Draft +# both of them will work, but you can only use one of them. +``` ### 1.1.1 - Fix the setting display bug in Japanese. @@ -201,7 +212,7 @@ date: 2023-07-23 # default is today, 默认是今天。 Format is YYYY-MM-DD coverurl: https://img.jxpeng.dev/2023/08/843e27a210847f05a0f7cfb121fec100.jpg # default is empty, 默认是空 type: Post # Post or Page, default is Post, 默认是Post slug: test # slug for url, default is empty, 默认是空 -stats: Draft # Draft, Invisible, Published, default is Draft, 默认是Draft +stats: Draft # Draft, Invisible, Published, default is Draft, 默认是Draft category: test # default is 'Obsidian', 默认是'Obsidian' summary: this is a summary for test post # default is empty, 默认是空 icon: fa-solid fa-camera # you can ignore this, default is empty, 默认是空,可直接删除 diff --git a/manifest.json b/manifest.json index cfb2057..421f8ea 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "id": "share-to-notionnext", "name": "Share to NotionNext", - "version": "1.1.1", + "version": "1.1.2", "minAppVersion": "0.0.1", "description": "Shares obsidian md file to notion with notion api for NotionNext web deploy, originally created by EasyChris/obsidian-to-notion.", "author": "EasyChris, jxpeng98", diff --git a/package.json b/package.json index e1ebb37..94de50c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "share-to-notionnext", - "version": "1.1.1", + "version": "1.1.2", "type": "module", "description": "Shares obsidian md file to notion with notion api for NotionNext web deploy, originally created by EasyChris/obsidian-to-notion.", "main": "main.js", diff --git a/src/upload/upload_next/Upload2NotionNext.ts b/src/upload/upload_next/Upload2NotionNext.ts index f56ed93..d7dba41 100644 --- a/src/upload/upload_next/Upload2NotionNext.ts +++ b/src/upload/upload_next/Upload2NotionNext.ts @@ -287,6 +287,7 @@ export class Upload2NotionNext extends UploadBaseNext { file2Block ); } + if (res.status === 200) { await updateYamlInfo(markdown, nowFile, res, app, this.plugin, this.dbDetails) } else { diff --git a/src/upload/upload_next/getMarkdownNext.ts b/src/upload/upload_next/getMarkdownNext.ts index 0bfde8e..f5f8875 100644 --- a/src/upload/upload_next/getMarkdownNext.ts +++ b/src/upload/upload_next/getMarkdownNext.ts @@ -13,6 +13,7 @@ export async function getNowFileMarkdownContentNext( let type = ''; let slug = ''; let stats = ''; + let status = ''; let category = ''; let summary = ''; let paword = ''; @@ -26,7 +27,7 @@ export async function getNowFileMarkdownContentNext( tags = FileCache.frontmatter.tags; type = FileCache.frontmatter.type; slug = FileCache.frontmatter.slug; - stats = FileCache.frontmatter.stats; + stats = FileCache.frontmatter.stats || FileCache.frontmatter.status; category = FileCache.frontmatter.category; summary = FileCache.frontmatter.summary; paword = FileCache.frontmatter.password;