mirror of
https://github.com/jxpeng98/obsidian-to-NotionNext
synced 2026-07-29 16:35:57 +08:00
Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3c3ec6881e | |||
|
|
a80155fafc | ||
| 3a814b8390 | |||
| bb522db9a2 | |||
| 201f72ae0e | |||
| be6f192dd8 | |||
| 4ce1019094 | |||
| 095c608511 |
@@ -1,4 +1,7 @@
|
|||||||
## Fix
|
## Fix
|
||||||
|
|
||||||
- Fix that `Text` property cannot be synced in the custom database.
|
- Fix a gif link in README.md
|
||||||
⚠️ **Note:** Remember to update the `Text` property in the database setting.
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- Change the success notice colour to green
|
||||||
|
|||||||
143
README.md
143
README.md
@@ -32,64 +32,77 @@
|
|||||||
- [x] ~~Support edit for database details in plugin settings. 支持编辑数据库详情~~
|
- [x] ~~Support edit for database details in plugin settings. 支持编辑数据库详情~~
|
||||||
|
|
||||||
## How to use
|
## How to use
|
||||||
|
|
||||||
If you want to use this plugin, you need to follow the following steps to set up the plugin. The steps can be divided into two parts: setting up the Notion API and setting up the plugin in Obsidian.
|
If you want to use this plugin, you need to follow the following steps to set up the plugin. The steps can be divided into two parts: setting up the Notion API and setting up the plugin in Obsidian.
|
||||||
|
|
||||||
### setting up the Notion API
|
### 1. Setting up the Notion API
|
||||||
|
|
||||||
1. go to [Notion API](https://www.notion.com/my-integrations) to create a new integration, and **copy the token**.
|
1). Go to [Notion API](https://www.notion.com/my-integrations) to create a new integration, and **copy the token**.
|
||||||

|
|
||||||
|
|
||||||
2. Create a database in your Notion workspace.
|

|
||||||
|
|
||||||
Open Notion, clink top-left `Create a new page` -> You can give a title for the page and press "/" Select 'Database - Full page'.
|
2). Create a database in your Notion workspace.
|
||||||
|
|
||||||

|
Open Notion, click top-left `Create` a new page` -> You can give a title for the page and press "/" Select 'Database - Full page'.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
Rename the database properties to `title` and `tags`.
|
Rename the database properties to `title` and `tags`.
|
||||||
**⚠️⚠️`title` is the title column! `tags` is lower case⚠️⚠️**
|
**⚠️⚠️`title` is the title column! `tags` is lower case⚠️⚠️**
|
||||||

|
|
||||||
|
|
||||||
3. Add the Notion API integration.
|

|
||||||
|
|
||||||
|
3). Add the Notion API integration.
|
||||||
|
|
||||||
Click the right-top '...' -> connections -> connect to -> find the integration you created and connect it.
|
Click the right-top '...' -> connections -> connect to -> find the integration you created and connect it.
|
||||||

|
|
||||||
|
|
||||||
4. Publish the database to the public.
|

|
||||||
|
|
||||||
|
4). Publish the database to the public.
|
||||||
Click the 'Share' -> 'Publish' -> 'Publish' -> **copy the database id from the URL**.
|
Click the 'Share' -> 'Publish' -> 'Publish' -> **copy the database id from the URL**.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### Setting up the plugin in Obsidian
|
### 2. Setting up the plugin in Obsidian
|
||||||
|
|
||||||
1. Go to Obsidian settings -> community plugins -> search 'NotionNext' -> install it.
|
1). Go to Obsidian settings -> community plugins -> search 'NotionNext' -> install it.
|
||||||

|

|
||||||
|
|
||||||
|
2). Open the plugin settings and create a new database.
|
||||||
|
|
||||||
2. Open the plugin settings and create a new database.
|
|
||||||

|

|
||||||
|
|
||||||
### Create a database
|
### 3. Create a database
|
||||||
|
|
||||||
**You can create three types of databases:**
|
**You can create three types of databases:**
|
||||||
|
|
||||||
#### General database
|
#### 1️⃣ General database
|
||||||
General database is the default database, which only has the `title` and `tags` columns. **⚠️⚠️`title` and `tags` are lower case⚠️⚠️**
|
|
||||||
|
General database is the default database, which only has the `title` and `tags` columns. **⚠️⚠️`title` and `tags` are lowercase⚠️⚠️**
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
The general is as follows:
|
The general is as follows:
|
||||||
|
|
||||||
- Full Name: the full name that you would like to give to the database.
|
- Full Name: the full name that you would like to give to the database.
|
||||||
- Abbreviate Name: the abbreviation that you would like to give to the database.
|
- Abbreviate Name: the abbreviation that you would like to give to the database.
|
||||||
- Notion tags sync: whether you want to sync the tags column to Notion.
|
- Notion tags sync: whether you want to sync the tags column to Notion.
|
||||||
- Customise title property: whether you want to change the `title` to another name (e.g., `name`).
|
- Customise title property: whether you want to change the `title` to another name (e.g., `name`).
|
||||||
- Notion API token: the token you copied from the Notion API page.
|
- Notion API token: the token you copied from the Notion API page.
|
||||||
- Notion Database ID: the database ID you copied from the Notion database URL. (e.g., only copy `7158cd3f70ce4f60afd9da5bdf74fd0c` between `site/` and `?` **https://jxpeng.notion.site/7158cd3f70ce4f60afd9da5bdf74fd0c?v=380317ac53734fc0b2471243c13e618f&pvs=4**)
|
- Notion Database ID: the database ID you copied from the Notion database URL. (e.g., only copy `7158cd3f70ce4f60afd9da5bdf74fd0c` between `site/` and `?`. `https://jxpeng.notion.site/7158cd3f70ce4f60afd9da5bdf74fd0c?v=380317ac5373sadasdas3c13e618f&pvs=4**`)
|
||||||
|
|
||||||
After setting, it should look like this:
|
After setting, it should look like this:
|
||||||

|
|
||||||
|

|
||||||
|
|
||||||
Once you click `save`, the new database will be created in the plugin settings and display in the detabase list.
|
Once you click `save`, the new database will be created in the plugin settings and display in the detabase list.
|
||||||

|
|
||||||
|
|
||||||
#### NotionNext database
|

|
||||||
|
|
||||||
|
#### 2️⃣ NotionNext database
|
||||||
|
|
||||||
If you use [NotionNext](https://github.com/tangly1024/NotionNext) to set up your website, you can use the NotionNext database. (**All the properties are in lowercase, and you do not need to change the properties**)
|
If you use [NotionNext](https://github.com/tangly1024/NotionNext) to set up your website, you can use the NotionNext database. (**All the properties are in lowercase, and you do not need to change the properties**)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
Like the general database, you need to fill in the following information:
|
Like the general database, you need to fill in the following information:
|
||||||
@@ -99,7 +112,8 @@ Like the general database, you need to fill in the following information:
|
|||||||
- Notion API token: the token you copied from the Notion API page.
|
- Notion API token: the token you copied from the Notion API page.
|
||||||
- Notion Database ID: the database ID you copied from the Notion database URL.
|
- Notion Database ID: the database ID you copied from the Notion database URL.
|
||||||
|
|
||||||
#### Custom database
|
#### 3️⃣ Custom database
|
||||||
|
|
||||||
The custom database is purely customised, and you can customise the properties you want to sync. (**All the properties are in lowercase, and you do not need to change the properties**)
|
The custom database is purely customised, and you can customise the properties you want to sync. (**All the properties are in lowercase, and you do not need to change the properties**)
|
||||||
|
|
||||||

|

|
||||||
@@ -112,22 +126,27 @@ The basic information is identical to the general database and NotionNext databa
|
|||||||
- Notion Database ID: the database ID you copied from the Notion database URL.
|
- Notion Database ID: the database ID you copied from the Notion database URL.
|
||||||
|
|
||||||
After adding the information, You can click `Add New Property` to add the properties you want to sync. There is no limit to the number of properties you can add.
|
After adding the information, You can click `Add New Property` to add the properties you want to sync. There is no limit to the number of properties you can add.
|
||||||

|
|
||||||
|

|
||||||
|
|
||||||
**⚠️⚠️⚠️**: **`Title column` is the main property in the Notion database, which has the open button to open the underlying page.** You can select the type of all other properties. **⚠️⚠️⚠️**
|
**⚠️⚠️⚠️**: **`Title column` is the main property in the Notion database, which has the open button to open the underlying page.** You can select the type of all other properties. **⚠️⚠️⚠️**
|
||||||

|
|
||||||
|
|
||||||
According to the previous shown database, you can use `title` as the `Title column`, and `Tags` as the property 1.
|

|
||||||

|
|
||||||
|
According to the previously shown database, you can use `title` as the `Title column`, and `Tags` as the property 1.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
**Until now, you have set up the plugin in Obsidian. You can start syncing your notes to Notion.**
|
**Until now, you have set up the plugin in Obsidian. You can start syncing your notes to Notion.**
|
||||||
|
|
||||||
### Start syncing
|
### 4. Start syncing
|
||||||
|
|
||||||
Create a new note in Obsidian, and fill in the front matter with the properties you want to sync.
|
Create a new note in Obsidian, and fill in the front matter with the properties you want to sync.
|
||||||
|
|
||||||
#### note for general database
|
#### 1️⃣ note for general database
|
||||||
|
|
||||||
For example, we can create a test note with the following front matter:
|
For example, we can create a test note with the following front matter:
|
||||||
|
|
||||||
``` markdown
|
``` markdown
|
||||||
---
|
---
|
||||||
title: test
|
title: test
|
||||||
@@ -138,9 +157,11 @@ This is a test file.
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||

|
After creating the note, you can click the `Share to NotionNext` button on the left sidebar to sync the note to Notion.
|
||||||
|
|
||||||
#### note for NotionNext database
|

|
||||||
|
|
||||||
|
#### 2️⃣ note for NotionNext database
|
||||||
|
|
||||||
We use the following front matter for the NotionNext database:
|
We use the following front matter for the NotionNext database:
|
||||||
|
|
||||||
@@ -166,13 +187,17 @@ NotionID-pengjiaxin: 8ba573de-8fdf-4681-b063-c39d26e7860e
|
|||||||
this is a test file
|
this is a test file
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
#### 3️⃣ note for custom database
|
||||||
|
|
||||||
#### note for custom database
|
##### sync title and tags
|
||||||
|
|
||||||
1. Use the previous created general database and rename `title` to `Name` and `tags` to `Tags` in Notion. The front matter for the custom database is as follows:
|
Use the previously created general database and rename `title` to `Name` and `tags` to `Tags` in Notion.
|
||||||

|
|
||||||
|

|
||||||
|
|
||||||
|
The front matter for the custom database is as follows:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
---
|
---
|
||||||
@@ -183,20 +208,28 @@ Tags:
|
|||||||
---
|
---
|
||||||
|
|
||||||
This is a test file.
|
This is a test file.
|
||||||
```markdown
|
```
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
2. Add more property to the custom database. For example, we can add a `summary` and `date` property to the custom database.
|
##### sync more properties
|
||||||
1. Click `Edit` in the plugin settings.
|
|
||||||
|
Add more property to the custom database. For example, we can add a `summary` and `date` property to the custom database.
|
||||||
|
|
||||||
|
1). Click `Edit` in the plugin settings.
|
||||||

|

|
||||||
2. Click `Add` and add the `summary` and `date` property.
|
2). Click `Add` and add the `summary` and `date` property.
|
||||||

|
|
||||||
3. After adding the properties, you can see the properties in the plugin settings.
|

|
||||||
|
|
||||||
|
3). After adding the properties, you can see the properties in the plugin settings.
|
||||||

|

|
||||||
4. Add the `summary` and `date` in Notion
|
4). Add the `summary` and `date` in Notion
|
||||||

|
|
||||||
5. Create a new note with the `summary` and `date` property.
|

|
||||||
|
|
||||||
|
5). Create a new note with the `summary` and `date` property.
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
---
|
---
|
||||||
Name: test-custom-more
|
Name: test-custom-more
|
||||||
@@ -209,28 +242,14 @@ This is a test file.
|
|||||||
|
|
||||||
This is a test file.
|
This is a test file.
|
||||||
```
|
```
|
||||||

|
|
||||||
|
|
||||||
|
6). Sync the note to Notion.
|
||||||
|
|
||||||
|

|
||||||
## 使用方法
|
|
||||||
如果你想使用这个插件,你需要完成下边的七个步骤。
|
|
||||||
1. 首先在你的Notion中创建一个数据库。
|
|
||||||
2. 点击右上角的'分享' -> '发布' -> '发布' -> 然后复制URL中的数据库ID。(版本不同,可能id的形式也不同。只需要复制在?之前的纯数字部分应该就可以了)
|
|
||||||
3. 去[Notion API](https://www.notion.com/my-integrations)创建一个新的API,然后复制token。
|
|
||||||
4. 回到你创建的Notion数据库,点击右上角的'...' -> 连接 -> 连接到 -> 把你刚才创建的API绑定到你的数据库
|
|
||||||
5. 回到Obsidian的设置 -> 社区插件 -> 搜索'NotionNext' -> 安装
|
|
||||||
6. 在插件设置中创建一个数据库,然后填写数据库的详情和你想要同步的属性 (**注意:Notion会识别表头的大小写,一定要和notion中的表头保持大小写一致**)。
|
|
||||||
- 你可以使用三种类型的数据库:
|
|
||||||
- NotionNext: 用于NotionNext模板的数据库。(**默认全部小写**)
|
|
||||||
- General: 用于普通的Notion数据库(**只有`title`和`tags`两个属性**)
|
|
||||||
- Custom: 用于自定义属性的数据库(你可以自定义你想要同步的属性)
|
|
||||||
7. 在Obsidian中创建一个新的笔记,然后在frontmatter中写入你想要的属性。
|
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Acknowledgement
|
## Acknowledgment
|
||||||
|
|
||||||
Thanks to the [original author](https://github.com/EasyChris/obsidian-to-notion) for developing such a useful plugin that can synchronize Obsidian to Notion. However, the original repository can only sync Name and Tag information. For those like me who use [NotionNext](https://github.com/tangly1024/NotionNext) to set up their website, this presents some limitations. Every time I import, I need to make a lot of modifications.
|
Thanks to the [original author](https://github.com/EasyChris/obsidian-to-notion) for developing such a useful plugin that can synchronize Obsidian to Notion. However, the original repository can only sync Name and Tag information. For those like me who use [NotionNext](https://github.com/tangly1024/NotionNext) to set up their website, this presents some limitations. Every time I import, I need to make a lot of modifications.
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"id": "share-to-notionnext",
|
"id": "share-to-notionnext",
|
||||||
"name": "Share to NotionNext",
|
"name": "Share to NotionNext",
|
||||||
"version": "2.3.2",
|
"version": "2.3.3",
|
||||||
"minAppVersion": "0.0.1",
|
"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.",
|
"description": "Shares obsidian md file to notion with notion api for NotionNext web deploy, originally created by EasyChris/obsidian-to-notion.",
|
||||||
"author": "EasyChris, jxpeng98",
|
"author": "EasyChris, jxpeng98",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "share-to-notionnext",
|
"name": "share-to-notionnext",
|
||||||
"version": "2.3.2",
|
"version": "2.3.3",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"description": "Shares obsidian md file to notion with notion api for NotionNext web deploy, originally created by EasyChris/obsidian-to-notion.",
|
"description": "Shares obsidian md file to notion with notion api for NotionNext web deploy, originally created by EasyChris/obsidian-to-notion.",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
|
|||||||
@@ -27,11 +27,11 @@ export const en = {
|
|||||||
DatabaseIDText: "Enter your Database ID",
|
DatabaseIDText: "Enter your Database ID",
|
||||||
BannerUrl: "Banner url (optional)",
|
BannerUrl: "Banner url (optional)",
|
||||||
BannerUrlDesc:
|
BannerUrlDesc:
|
||||||
"Default is empty, if you want to show a banner, please enter the url (like: https://abc.com/b.png)",
|
"Default is empty, if you want to show a banner, please enter the url (like: https://abc.com/b.png)",
|
||||||
BannerUrlText: "Enter your banner url",
|
BannerUrlText: "Enter your banner url",
|
||||||
NotionUser: "Notion ID (username, optional)",
|
NotionUser: "Notion ID (username, optional)",
|
||||||
NotionUserDesc:
|
NotionUserDesc:
|
||||||
"Collect from share link likes:https://username.notion.site. Your notion id is [username]",
|
"Collect from share link likes:https://username.notion.site. Your notion id is [username]",
|
||||||
NotionUserText: "Enter your notion ID",
|
NotionUserText: "Enter your notion ID",
|
||||||
NotionLinkDisplay: "Notion Link Display",
|
NotionLinkDisplay: "Notion Link Display",
|
||||||
NotionLinkDisplayDesc: "Default is ON, if you want to hide the link in the front matter, please turn it off",
|
NotionLinkDisplayDesc: "Default is ON, if you want to hide the link in the front matter, please turn it off",
|
||||||
@@ -48,23 +48,23 @@ export const en = {
|
|||||||
NotionCustomValues: "Customise values property",
|
NotionCustomValues: "Customise values property",
|
||||||
NotionCustomValuesDesc: "Modify the column name of the Notion database,one per line",
|
NotionCustomValuesDesc: "Modify the column name of the Notion database,one per line",
|
||||||
NotionCustomValuesText: "Enter all properties that you want to sync",
|
NotionCustomValuesText: "Enter all properties that you want to sync",
|
||||||
NotYetFinish:
|
NotYetFinish: "Not finished. This function will be available in the next version",
|
||||||
"Not finished. This function will be available in the next version",
|
|
||||||
PlaceHolder: "Enter database Name",
|
PlaceHolder: "Enter database Name",
|
||||||
"notion-logo": "Share to NotionNext",
|
"notion-logo": "Share to NotionNext",
|
||||||
"sync-success": "Sync to NotionNext success: \n",
|
"sync-preffix": "Sync to ",
|
||||||
"sync-fail": "Sync to NotionNext fail: \n",
|
"sync-success": "success",
|
||||||
|
"sync-fail": "failed",
|
||||||
"open-notion": "Please open the file that needs to be synchronized",
|
"open-notion": "Please open the file that needs to be synchronized",
|
||||||
"config-secrets-notion-api":
|
"config-secrets-notion-api":
|
||||||
"Please set up the notion API in the settings tab.",
|
"Please set up the notion API in the settings tab.",
|
||||||
"config-secrets-database-id":
|
"config-secrets-database-id":
|
||||||
"Please set up the database id in the settings tab.",
|
"Please set up the database id in the settings tab.",
|
||||||
"set-tags-fail":
|
"set-tags-fail":
|
||||||
"Set tags fail,please check the frontmatter of the file or close the tag switch in the settings tab.",
|
"Set tags fail,please check the frontmatter of the file or close the tag switch in the settings tab.",
|
||||||
NNonMissing:
|
NNonMissing:
|
||||||
"The 'NNon' property is missing in the settings. Please set it up.",
|
"The 'NNon' property is missing in the settings. Please set it up.",
|
||||||
"set-api-id":
|
"set-api-id":
|
||||||
"Please set up the notion API and database ID in the settings tab.",
|
"Please set up the notion API and database ID in the settings tab.",
|
||||||
NotionCustomSettingHeader: "Notion Custom Database Settings",
|
NotionCustomSettingHeader: "Notion Custom Database Settings",
|
||||||
NotionCustomButton: "Notion Customised command switch",
|
NotionCustomButton: "Notion Customised command switch",
|
||||||
NotionCustomButtonDesc: "Open this option, Sync to Notion Customised Database command will be displayed in the command palette",
|
NotionCustomButtonDesc: "Open this option, Sync to Notion Customised Database command will be displayed in the command palette",
|
||||||
@@ -75,4 +75,5 @@ export const en = {
|
|||||||
AddCustomProperty: "Add Custom Property",
|
AddCustomProperty: "Add Custom Property",
|
||||||
AddNewProperty: "Add New Property",
|
AddNewProperty: "Add New Property",
|
||||||
AddNewPropertyDesc: "Add new property match with your notion database",
|
AddNewPropertyDesc: "Add new property match with your notion database",
|
||||||
|
CopyErrorMessage: "Auto copy failed, please copy it manually",
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,4 +67,5 @@ export const ja = {
|
|||||||
AddCustomProperty: "カスタムプロパティを追加",
|
AddCustomProperty: "カスタムプロパティを追加",
|
||||||
AddNewProperty: "新しいプロパティを追加",
|
AddNewProperty: "新しいプロパティを追加",
|
||||||
AddNewPropertyDesc: "新しいプロパティを追加してください",
|
AddNewPropertyDesc: "新しいプロパティを追加してください",
|
||||||
|
CopyErrorMessage: "自動コピーに失敗しました",
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -70,4 +70,5 @@ export const zh = {
|
|||||||
AddCustomProperty: "添加自定义属性",
|
AddCustomProperty: "添加自定义属性",
|
||||||
AddNewProperty: "添加新属性",
|
AddNewProperty: "添加新属性",
|
||||||
AddNewPropertyDesc: "添加一个和Notion数据库匹配的新属性",
|
AddNewPropertyDesc: "添加一个和Notion数据库匹配的新属性",
|
||||||
|
CopyErrorMessage: "复制链接失败,请手动复制",
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { App, Notice, TFile } from "obsidian";
|
import { App, Notice, TFile } from "obsidian";
|
||||||
import ObsidianSyncNotionPlugin from "../main";
|
import ObsidianSyncNotionPlugin from "../main";
|
||||||
import { DatabaseDetails } from "../ui/settingTabs";
|
import { DatabaseDetails } from "../ui/settingTabs";
|
||||||
|
import { i18nConfig } from "src/lang/I18n";
|
||||||
|
|
||||||
export async function updateYamlInfo(
|
export async function updateYamlInfo(
|
||||||
yamlContent: string,
|
yamlContent: string,
|
||||||
@@ -37,6 +38,7 @@ export async function updateYamlInfo(
|
|||||||
try {
|
try {
|
||||||
await navigator.clipboard.writeText(url)
|
await navigator.clipboard.writeText(url)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
new Notice(`复制链接失败,请手动复制${error}`)
|
console.log(error)
|
||||||
|
new Notice(`${i18nConfig.CopyErrorMessage}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,13 +18,6 @@ export async function uploadCommandNext(
|
|||||||
|
|
||||||
const { notionAPI, databaseID } = dbDetails;
|
const { notionAPI, databaseID } = dbDetails;
|
||||||
|
|
||||||
// Check if NNon exists
|
|
||||||
// if (NNon === undefined) {
|
|
||||||
// const NNonmessage = i18nConfig.NNonMissing;
|
|
||||||
// new Notice(NNonmessage);
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// Check if the user has set up the Notion API and database ID
|
// Check if the user has set up the Notion API and database ID
|
||||||
if (notionAPI === "" || databaseID === "") {
|
if (notionAPI === "" || databaseID === "") {
|
||||||
const setAPIMessage = i18nConfig["set-api-id"];
|
const setAPIMessage = i18nConfig["set-api-id"];
|
||||||
@@ -54,7 +47,7 @@ export async function uploadCommandNext(
|
|||||||
const res = await upload.syncMarkdownToNotionNext(basename, emoji, cover, tags, type, slug, stats, category, summary, paword, favicon, datetime, markDownData, nowFile, this.app);
|
const res = await upload.syncMarkdownToNotionNext(basename, emoji, cover, tags, type, slug, stats, category, summary, paword, favicon, datetime, markDownData, nowFile, this.app);
|
||||||
|
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
new Notice(`${i18nConfig["sync-success"]}${basename}`);
|
new Notice(`${i18nConfig["sync-preffix"]} ${basename} ${i18nConfig["sync-success"]}`).noticeEl.style.color = "green";
|
||||||
} else {
|
} else {
|
||||||
new Notice(`${i18nConfig["sync-fail"]}${basename}`, 5000);
|
new Notice(`${i18nConfig["sync-fail"]}${basename}`, 5000);
|
||||||
}
|
}
|
||||||
@@ -88,7 +81,7 @@ export async function uploadCommandGeneral(
|
|||||||
const res = await upload.syncMarkdownToNotionGeneral(basename, cover, tags, markDownData, nowFile, this.app);
|
const res = await upload.syncMarkdownToNotionGeneral(basename, cover, tags, markDownData, nowFile, this.app);
|
||||||
|
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
new Notice(`${i18nConfig["sync-success"]}${basename}`);
|
new Notice(`${i18nConfig["sync-success"]}${basename}`).noticeEl.style.color = "green";
|
||||||
} else {
|
} else {
|
||||||
new Notice(`${i18nConfig["sync-fail"]}${basename}`, 5000);
|
new Notice(`${i18nConfig["sync-fail"]}${basename}`, 5000);
|
||||||
}
|
}
|
||||||
@@ -122,7 +115,7 @@ export async function uploadCommandCustom(
|
|||||||
const res = await upload.syncMarkdownToNotionCustom(cover, customValues, markDownData, nowFile, this.app);
|
const res = await upload.syncMarkdownToNotionCustom(cover, customValues, markDownData, nowFile, this.app);
|
||||||
|
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
new Notice(`${i18nConfig["sync-success"]}${basename}`);
|
new Notice(`${i18nConfig["sync-success"]}${basename}`).noticeEl.style.color = "green";
|
||||||
} else {
|
} else {
|
||||||
new Notice(`${i18nConfig["sync-fail"]}${basename}`, 5000);
|
new Notice(`${i18nConfig["sync-fail"]}${basename}`, 5000);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ export class Upload2NotionCustom extends UploadBaseCustom {
|
|||||||
app: App,
|
app: App,
|
||||||
): Promise<any> {
|
): Promise<any> {
|
||||||
const options = {
|
const options = {
|
||||||
|
strictImageUrls: true,
|
||||||
notionLimits: {
|
notionLimits: {
|
||||||
truncate: false,
|
truncate: false,
|
||||||
}
|
}
|
||||||
@@ -123,7 +124,7 @@ export class Upload2NotionCustom extends UploadBaseCustom {
|
|||||||
} else {
|
} else {
|
||||||
res = await this.createPage(cover, customValues, file2Block);
|
res = await this.createPage(cover, customValues, file2Block);
|
||||||
}
|
}
|
||||||
if (res.status === 200) {
|
if (res && res.status === 200) {
|
||||||
await updateYamlInfo(markdown, nowFile, res, app, this.plugin, this.dbDetails);
|
await updateYamlInfo(markdown, nowFile, res, app, this.plugin, this.dbDetails);
|
||||||
} else {
|
} else {
|
||||||
new Notice(`${res.text}`);
|
new Notice(`${res.text}`);
|
||||||
@@ -228,7 +229,7 @@ export class Upload2NotionCustom extends UploadBaseCustom {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
console.log(properties)
|
// console.log(properties)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
parent: {
|
parent: {
|
||||||
|
|||||||
Reference in New Issue
Block a user