mirror of
https://github.com/jxpeng98/obsidian-to-NotionNext
synced 2026-07-30 00:48:36 +08:00
change tags titleicon and summary to optional function in next database
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# Changelog v2.2.3
|
||||
- Update NotionNext function that
|
||||
- `tags`, `titleicon`, `slug` and `summary` are now optional. You can remove them from the frontmatter if you don't need them.
|
||||
|
||||
## Bug Fixes
|
||||
|
||||
- Fix a bug that 'text' property cannot be synchronized. 修复了一个无法同步'text'属性的bug。
|
||||
- 更新 NotionNext 同步功能
|
||||
- `tags`, `titleicon`, `slug` 和 `summary` 现在不是必选项了。你可以从你的模板中删除这些字段。
|
||||
|
||||
@@ -78,8 +78,13 @@ tags:
|
||||
- web # add more tags if you want
|
||||
---
|
||||
```
|
||||
<details> <summary> Update </summary>
|
||||
|
||||
### 2.2.5
|
||||
|
||||
- Update NotionNext function that
|
||||
- `tags`, `titleicon`, `slug` and `summary` are now optional. You can remove them from the frontmatter if you don't need them.
|
||||
|
||||
## Update
|
||||
|
||||
### 2.2.3
|
||||
|
||||
@@ -112,6 +117,8 @@ tags:
|
||||
- [x] 'Phone'
|
||||
- [x] 'File' (**Only support external embedded files**)
|
||||
|
||||
</details>
|
||||
|
||||

|
||||
- Once you create the properties, you can preview the database details in the plugin settings.
|
||||

|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "share-to-notionnext",
|
||||
"name": "Share to NotionNext",
|
||||
"version": "2.2.4",
|
||||
"version": "2.2.5",
|
||||
"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",
|
||||
|
||||
@@ -12,7 +12,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
|
||||
status: 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, 默认是空,可直接删除
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "share-to-notionnext",
|
||||
"version": "2.2.4",
|
||||
"version": "2.2.5",
|
||||
"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",
|
||||
|
||||
@@ -88,9 +88,6 @@ export class Upload2NotionNext extends UploadBaseNext {
|
||||
parent: {
|
||||
database_id: databaseID,
|
||||
},
|
||||
icon: {
|
||||
emoji: emoji || '📜'
|
||||
},
|
||||
properties: {
|
||||
title: {
|
||||
title: [
|
||||
@@ -101,25 +98,11 @@ export class Upload2NotionNext extends UploadBaseNext {
|
||||
},
|
||||
],
|
||||
},
|
||||
tags: {
|
||||
multi_select: tags && true ? tags.map(tag => {
|
||||
return { "name": tag }
|
||||
}) : [],
|
||||
},
|
||||
type: {
|
||||
select: {
|
||||
name: type || 'Post'
|
||||
}
|
||||
},
|
||||
slug: {
|
||||
rich_text: [
|
||||
{
|
||||
text: {
|
||||
content: slug || ''
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
status: {
|
||||
select: {
|
||||
name: stats || 'Draft'
|
||||
@@ -130,15 +113,7 @@ export class Upload2NotionNext extends UploadBaseNext {
|
||||
name: category || 'Obsidian'
|
||||
}
|
||||
},
|
||||
summary: {
|
||||
rich_text: [
|
||||
{
|
||||
text: {
|
||||
content: summary || ''
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
password: {
|
||||
rich_text: [
|
||||
{
|
||||
@@ -165,6 +140,52 @@ export class Upload2NotionNext extends UploadBaseNext {
|
||||
},
|
||||
children: childArr,
|
||||
}
|
||||
|
||||
// add tags
|
||||
if (tags) {
|
||||
bodyString.properties.tags = {
|
||||
multi_select: tags.map(tag => {
|
||||
return { "name": tag }
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// add title icon
|
||||
if (emoji) {
|
||||
bodyString.icon = {
|
||||
emoji: emoji
|
||||
}
|
||||
}
|
||||
|
||||
// add slug
|
||||
if (slug) {
|
||||
bodyString.properties.slug = {
|
||||
rich_text: [
|
||||
{
|
||||
text: {
|
||||
content: slug
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
// check if summary is available
|
||||
if (summary) {
|
||||
bodyString.properties.summary = {
|
||||
rich_text: [
|
||||
{
|
||||
text: {
|
||||
content: summary
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (cover) {
|
||||
bodyString.cover = {
|
||||
type: "external",
|
||||
|
||||
@@ -233,5 +233,4 @@ export class Upload2NotionCustom extends UploadBaseCustom {
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user