mirror of
https://github.com/jxpeng98/obsidian-to-NotionNext
synced 2026-07-29 16:35:57 +08:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
913fa4dd03 | ||
|
|
f638310f31 | ||
|
|
c2421f7a84 | ||
|
|
630e3a20c2 |
1
.github/workflows/test.yml
vendored
1
.github/workflows/test.yml
vendored
@@ -4,7 +4,6 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- "*"
|
||||
- "!master"
|
||||
|
||||
env:
|
||||
PLUGIN_NAME: share-to-notionnext # Change this to match the id of your plugin.
|
||||
|
||||
14
README-zh.md
14
README-zh.md
@@ -5,6 +5,20 @@
|
||||
所以我在[原作者](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.0
|
||||
- 修复设置中自定义标题的显示问题。
|
||||
- 增加了标签同步的控制按钮。以减少空标签集造成的上传失败。
|
||||
|
||||
19
README.md
19
README.md
@@ -14,6 +14,23 @@ Thus, based on the [original author's work](https://github.com/EasyChris/obsidia
|
||||
**Now, support both NotionNext and General databases.**
|
||||
|
||||
## 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
|
||||
- Fix the setting display bug in Japanese.
|
||||
- Add Japanese translation.
|
||||
|
||||
### 1.1.0
|
||||
- Fix the custom name setting tab display bug.
|
||||
@@ -164,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, 默认是空
|
||||
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, 默认是空,可直接删除
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"id": "share-to-notionnext",
|
||||
"name": "Share to NotionNext",
|
||||
"version": "1.1.0",
|
||||
"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",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "share-to-notionnext",
|
||||
"version": "1.1.0",
|
||||
"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",
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
import {en} from "./en";
|
||||
import {zh} from "./zh";
|
||||
import {en} from "./locale/en";
|
||||
import {zh} from "./locale/zh";
|
||||
import {ja} from "./locale/ja";
|
||||
|
||||
export const I18n: { [key: string]: any } = {
|
||||
export const I18n: {[key: string]:any} = {
|
||||
en,
|
||||
zh,
|
||||
ja,
|
||||
};
|
||||
|
||||
export const I18nConfig = (lang: any): any => {
|
||||
export const I18nConfig = (lang: string): any => {
|
||||
return I18n[lang];
|
||||
};
|
||||
|
||||
export const i18nConfig = I18nConfig(
|
||||
window.localStorage.getItem("language") || "en",
|
||||
); // Export i18nConfig
|
||||
const storedLanguage = window.localStorage.getItem("language");
|
||||
|
||||
export const i18nConfig = I18n[storedLanguage || window.navigator.language.split('-')[0] || "en"];
|
||||
|
||||
46
src/lang/locale/ja.ts
Normal file
46
src/lang/locale/ja.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
export const ja = {
|
||||
ribbonIcon: "NotionNextで共有",
|
||||
GeneralSetting: "一般設定",
|
||||
CommandID: "share-to-notionnext",
|
||||
CommandName: "NotionNextデータベースに共有",
|
||||
CommandIDGeneral: "share-to-notion",
|
||||
CommandNameGeneral: "一般的なNotionデータベースに共有",
|
||||
NotionNextButton: "NotionNext同期",
|
||||
NotionNextButtonDesc: "このオプションを開くと、NotionNext同期コマンドがコマンドパレットに表示されます(デフォルト:ON)",
|
||||
NotionNextSettingHeader: "NotionNextデータベース設定",
|
||||
NotionAPI: "Notion API トークン",
|
||||
NotionAPIDesc: "https://www.notion.so/my-integrations から生成してください",
|
||||
NotionAPIText: "Notion API トークンを入力",
|
||||
DatabaseID: "データベースID",
|
||||
DatabaseIDText: "データベースIDを入力",
|
||||
BannerUrl: "バナーのURL(任意)",
|
||||
BannerUrlDesc: "デフォルトは空白です。バナーを表示したい場合は、URLを入力してください(例:https://minioapi.pjx.ac.cn/img1/2023/11/b7b40a0724e93b7d7ab494bb3b8a2da8.png)",
|
||||
BannerUrlText: "バナーのURLを入力",
|
||||
NotionUser: "Notion ID(ユーザー名、任意)",
|
||||
NotionUserDesc: "共有リンクから取得(例:https://username.notion.site)。Notion IDは[username]です",
|
||||
NotionUserText: "Notion IDを入力",
|
||||
NotionGeneralSettingHeader: "一般的なNotionデータベース設定",
|
||||
NotionGeneralButton: "一般的なNotion同期",
|
||||
NotionGeneralButtonDesc: "このオプションを開くと、一般的なNotionデータベース同期コマンドがコマンドパレットに表示されます(デフォルト:ON)",
|
||||
NotionTagButton: "Notionタグ同期",
|
||||
NotionTagButtonDesc: "タグを一般的なNotionデータベースに同期(デフォルト:ON)",
|
||||
NotionCustomTitle: "タイトルのカスタマイズ",
|
||||
NotionCustomTitleDesc: "Notionデータベースの列名を変更(デフォルト:OFF)",
|
||||
NotionCustomTitleName: "希望のタイトル名",
|
||||
NotionCustomTitleNameDesc: "Notionデータベースの最初の列のための希望のタイトル名を入力(デフォルト:title)",
|
||||
NotionCustomTitleText: "名前を入力",
|
||||
NotYetFinish: "未完了。この機能は次のバージョンで利用可能になります",
|
||||
PlaceHolder: "データベース名を入力",
|
||||
"notion-logo": "NotionNextで共有",
|
||||
"sync-success": "NotionNextへの同期に成功:\n",
|
||||
"sync-fail": "NotionNextへの同期に失敗:\n",
|
||||
"open-notion": "同期が必要なファイルを開いてください",
|
||||
"config-secrets-notion-api": "設定タブでNotion APIを設定してください",
|
||||
"config-secrets-database-id": "設定タブでデータベースIDを設定してください",
|
||||
"set-tags-fail": "タグの設定に失敗。ファイルのfrontmatterを確認するか、設定タブでタグのスイッチをオフにしてください",
|
||||
NNonMissing: "設定に 'NNon' プロパティがありません。設定してください",
|
||||
"set-api-id": "設定タブでNotion APIおよびデータベースIDを設定してください",
|
||||
NotionCustomSettingHeader: "Notionカスタムデータベース設定",
|
||||
NotionCustomButton: "Notionカスタマイズコマンドの切り替え",
|
||||
NotionCustomButtonDesc: "このオプションを開くと、Notionカスタムデータベース同期コマンドがコマンドパレットに表示されます",
|
||||
};
|
||||
@@ -251,6 +251,7 @@ export class Upload2NotionNext extends UploadBaseNext {
|
||||
file2Block
|
||||
);
|
||||
}
|
||||
|
||||
if (res.status === 200) {
|
||||
await updateYamlInfo(markdown, nowFile, res, app, this.plugin)
|
||||
} else {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user