add the property 'status' for NotionNext

This commit is contained in:
Jiaxin Peng
2023-12-06 15:19:57 +00:00
parent 630e3a20c2
commit c2421f7a84
4 changed files with 29 additions and 2 deletions

View File

@@ -5,6 +5,17 @@
所以我在[原作者](https://github.com/EasyChris/obsidian-to-notion)的基础之上,增加了匹配[NotionNext](https://github.com/tangly1024/NotionNext)模板的功能。这样可以直接在Obsidian编辑整理好之后一键发布。 所以我在[原作者](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 ### 1.1.1
- 修复了在日语系统下,无法显示设置按钮的错误。 - 修复了在日语系统下,无法显示设置按钮的错误。
- 增加日语翻译。 - 增加日语翻译。

View File

@@ -14,6 +14,20 @@ Thus, based on the [original author's work](https://github.com/EasyChris/obsidia
**Now, support both NotionNext and General databases.** **Now, support both NotionNext and General databases.**
## Update ## Update
### 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`都可以使用,但是你只能使用其中一个。**
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 ### 1.1.1
- Fix the setting display bug in Japanese. - Fix the setting display bug in Japanese.
- Add Japanese translation. - Add Japanese translation.
@@ -167,7 +181,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 默认是空 coverurl: https://img.jxpeng.dev/2023/08/843e27a210847f05a0f7cfb121fec100.jpg # default is empty 默认是空
type: Post # Post or Page, default is Post 默认是Post type: Post # Post or Page, default is Post 默认是Post
slug: test # slug for url, default is empty 默认是空 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' category: test # default is 'Obsidian' 默认是'Obsidian'
summary: this is a summary for test post # default is empty 默认是空 summary: this is a summary for test post # default is empty 默认是空
icon: fa-solid fa-camera # you can ignore this, default is empty 默认是空,可直接删除 icon: fa-solid fa-camera # you can ignore this, default is empty 默认是空,可直接删除

View File

@@ -251,6 +251,7 @@ export class Upload2NotionNext extends UploadBaseNext {
file2Block file2Block
); );
} }
if (res.status === 200) { if (res.status === 200) {
await updateYamlInfo(markdown, nowFile, res, app, this.plugin) await updateYamlInfo(markdown, nowFile, res, app, this.plugin)
} else { } else {

View File

@@ -13,6 +13,7 @@ export async function getNowFileMarkdownContentNext(
let type = ''; let type = '';
let slug = ''; let slug = '';
let stats = ''; let stats = '';
let status = '';
let category = ''; let category = '';
let summary = ''; let summary = '';
let paword = ''; let paword = '';
@@ -26,7 +27,7 @@ export async function getNowFileMarkdownContentNext(
tags = FileCache.frontmatter.tags; tags = FileCache.frontmatter.tags;
type = FileCache.frontmatter.type; type = FileCache.frontmatter.type;
slug = FileCache.frontmatter.slug; slug = FileCache.frontmatter.slug;
stats = FileCache.frontmatter.stats; stats = FileCache.frontmatter.stats || FileCache.frontmatter.status;
category = FileCache.frontmatter.category; category = FileCache.frontmatter.category;
summary = FileCache.frontmatter.summary; summary = FileCache.frontmatter.summary;
paword = FileCache.frontmatter.password; paword = FileCache.frontmatter.password;