Compare commits

..

5 Commits
0.0.2 ... 0.0.5

Author SHA1 Message Date
Jiaxin Peng
9be679f456 amend the template 2023-08-10 09:44:06 +01:00
Jiaxin Peng
a0f5d2d51b update the notion version 2023-08-10 09:30:27 +01:00
Jiaxin Peng
a68a3920ad minor update 2023-08-10 09:26:50 +01:00
Jiaxin Peng
76d3fc9872 Update version to 0.0.3 2023-08-10 09:15:26 +01:00
Jiaxin Peng
e3fb50b205 Update version to 0.0.2 2023-08-10 09:07:22 +01:00
9 changed files with 92 additions and 51 deletions

View File

@@ -6,7 +6,7 @@ on:
- "*"
env:
PLUGIN_NAME: obsidian-to-notion
PLUGIN_NAME: share-to-notionnext
jobs:
build:
@@ -23,4 +23,4 @@ jobs:
id: build
run: |
npm install
npm run build
npm run build

View File

@@ -6,7 +6,7 @@ on:
- "*"
env:
PLUGIN_NAME: obsidian-to-notion # Change this to match the id of your plugin.
PLUGIN_NAME: share-to-notionnext # Change this to match the id of your plugin.
jobs:
build:
@@ -34,7 +34,7 @@ jobs:
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
VERSION: ${{ github.ref }}
with:
tag_name: ${{ github.ref }}
@@ -46,7 +46,7 @@ jobs:
id: upload-zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ env.PLUGIN_NAME }}.zip
@@ -57,7 +57,7 @@ jobs:
id: upload-main
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./main.js
@@ -68,20 +68,31 @@ jobs:
id: upload-manifest
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./manifest.json
asset_name: manifest.json
asset_content_type: application/json
- name: Upload markdown template
id: upload-md
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./obsidian_template.md
asset_name: template.md
asset_content_type: text/markdown
# - name: Upload styles.css
# id: upload-css
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./styles.css
# asset_name: styles.css
# asset_content_type: text/css
# asset_content_type: text/css

View File

@@ -1,4 +1,4 @@
# Obsidian to NotionNext
# Obsidian share to NotionNext
感谢[原作者](https://github.com/EasyChris/obsidian-to-notion)开发出了这么好用的插件能够将obsidian同步到notion。 但是原仓库只能同步Name和Tags信息如果像我一样通过[NotionNext](https://github.com/tangly1024/NotionNext)来搭建自己的网页,就有一些局限性。每次导入之后都需要进行大量的修改。
所以我在[原作者](https://github.com/EasyChris/obsidian-to-notion)的基础之上,增加了匹配[NotionNext](https://github.com/tangly1024/NotionNext)模板的功能。这样可以直接在Obsidian编辑整理好之后一键发布。
@@ -11,6 +11,7 @@
### 准备安装
在安装插件之前,你必须配置好了以下内容:
1. 你的NotionNext数据库。
2. 根据原作者的readme.md配置好了Notion API并且已经和你的NotionNext仓库关联。
3. NotionNext Database ID
@@ -25,7 +26,10 @@
- summary
- password
- icon
**如果你是直接复制的NotionNext的模板这些内容应该已经有了。我在原作者的基础之上对本插件的内容进行了更改所以你只需要保证你的数据库有如上内容并且所有的字母都是小写**
**如果你是直接复制的NotionNext的模板这些内容应该已经有了。我在原作者的基础之上对本插件的内容进行了更改所以你只需要保证你的数据库有如上内容并且所有的字母都是小写**
**⚠️⚠️⚠️:表头全部小写!!!顺序无所谓!**
### 安装插件
@@ -37,24 +41,31 @@
### 使用插件
在仓库中我上传了一个模板你可以直接复制到你的模板文件夹中。然后使用Obsidian的模板功能一键生成新笔记。
如果你不想使用模板你也可以直接在Obsidian中创建一个新的文件然后复制下边的内容。然后保存。
```markdown
---
type: Post # Post or Page, the default is Post
slug: test # slug for url, the default is
stats: Draft # Draft, Invisible, Published
category: test
summary: this is a summary for test post
icon: fa-solid fa-camera # you can ignore this
password: "1234" # if you donot want to set password, you can delete this line
# default value has been set.
# for any unwanted value, you can delete it or set it to empty.
# for example, if you donot want to set password, you can delete password: "1234" or set it to password: ""
# 我已经在插件中设置了默认值,如果有不需要的选项,可以直接删除。
# 例如你不需要密码选项你可以将password: "1234"删除,或者将它设置为空。
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
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 默认是空,可直接删除
password: "1234" # if you donot want to set password, you can delete this line, default is empty 默认是空,可直接删除
# 现在必须开启tags选项否则会报错
tags:
- test # tags for post
- test # tags for post
- web # add more tags if you want
---
Contents Below
```
模板使用如下:
![](https://img.jxpeng.dev/2023/08/5ba5e7aeb86650c060c620786371717c.mp4)
@@ -64,7 +75,9 @@ Contents Below
---
**以下为原README.md**
非常感谢原作者的开发,我只是在原作者的基础之上进行了修改,增加了一些功能。如果你觉得这个插件对你有帮助,可以给[原作者](https://github.com/EasyChris/obsidian-to-notion)一个star。
# Obsidian to Notion

View File

@@ -1,5 +1,6 @@
# Obsidian to NotionNext
[中文文档](README-zh.md)
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 Tags 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.
Thus, based on the [original author's work](https://github.com/EasyChris/obsidian-to-notion), I've added a feature to match the [NotionNext](https://github.com/tangly1024/NotionNext) template. This way, you can edit directly in Obsidian and publish with a single click after organizing.
@@ -26,8 +27,10 @@ Before installing the plugin, you must have set up the following:
- summary
- password
- icon
**If you've directly copied the NotionNext template, these contents should already exist. I've made changes to this plugin based on the original author's work. All you need to ensure is that your database has the above content, and every letter is in lowercase!!!**
**⚠️⚠️⚠️: All headers are in lowercase!!! The order doesn't matter!**
**If you've directly copied the NotionNext template, these contents should already exist. I've made changes to this plugin based on the original author's work. All you need to ensure is that your database has the above content, and every letter is in lowercase!!!**
**⚠️⚠️⚠️: All headers are in lowercase!!! The order doesn't matter!**
### Plugin Installation
1. Close Obsidian.
@@ -42,19 +45,26 @@ In the repository, I have uploaded a template which you can directly copy into y
If you don't want to use the template, you can also directly create a new file in Obsidian and then copy the content below. Then save it.
```markdown
---
type: Post # Post or Page, the default is Post
slug: test # slug for url, the default is
stats: Draft # Draft, Invisible, Published
category: test
summary: this is a summary for test post
icon: fa-solid fa-camera # you can ignore this
password: "1234" # if you donot want to set password, you can delete this line
# default value has been set.
# for any unwanted value, you can delete it or set it to empty.
# for example, if you donot want to set password, you can delete password: "1234" or set it to password: ""
# 我已经在插件中设置了默认值,如果有不需要的选项,可以直接删除。
# 例如你不需要密码选项你可以将password: "1234"删除,或者将它设置为空。
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
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 默认是空,可直接删除
password: "1234" # if you donot want to set password, you can delete this line, default is empty 默认是空,可直接删除
# 现在必须开启tags选项否则会报错
tags:
- test # tags for post
- test # tags for post
- web # add more tags if you want
---
Contents Below
```
Usage of the template is as follows:
![](https://img.jxpeng.dev/2023/08/189384bf03c562030f4828343e1b7a6c.gif)
@@ -63,7 +73,9 @@ Usage of the template is as follows:
![](https://img.jxpeng.dev/2023/08/6063dd06eea4ee6939b5058dd129a698.gif)
---
**Original README.md**
Many Thanks for the original author's work. I've only made some changes to the original author's work. If you find this plugin useful, please give the [original author](https://github.com/EasyChris/obsidian-to-notion) a star.
# Obsidian to Notion

View File

@@ -19,7 +19,7 @@ export class Upload2Notion {
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + this.app.settings.notionAPI,
'Notion-Version': '2022-02-22',
'Notion-Version': '2022-06-28',
},
body: ''
})
@@ -63,7 +63,7 @@ export class Upload2Notion {
rich_text: [
{
text: {
content: slug || 'obsidian'
content: slug || ''
}
}
]

View File

@@ -1,9 +1,9 @@
{
"id": "share-to-notionnext",
"name": "Share markdown to NotionNext",
"version": "0.0.2",
"name": "Share to NotionNext",
"version": "0.0.5",
"minAppVersion": "0.0.1",
"description": "This is a plugin for Obsidian. This plugin share obsidian md file to notion with notion api for NotionNext web deploy.",
"description": "This is a plugin for Obsidian. This plugin shares obsidian md file to notion with notion api for NotionNext web deploy.",
"author": "jxpeng98",
"authorUrl": "https://github.com/jxpeng98/obsidian-to-NotionNext",
"isDesktopOnly": false

View File

@@ -1,15 +0,0 @@
---
type: Post // Post or Page
slug: test // slug for url
stats: Draft // Draft, Invisible, Published
category: test
summary: this is a summary for test post
icon: fa-solid fa-camera // you can ignore this
password: "1234" // if you donot want to set password, you can delete this line
tags:
- test // tags for post
- web // add more tags if you want
---
Contents Below

20
obsidian_template.md Normal file
View File

@@ -0,0 +1,20 @@
---
# default value has been set.
# for any unwanted value, you can delete it or set it to empty.
# for example, if you donot want to set password, you can delete password: "1234" or set it to password: ""
# 我已经在插件中设置了默认值,如果有不需要的选项,可以直接删除。
# 例如你不需要密码选项你可以将password: "1234"删除,或者将它设置为空。
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
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 默认是空,可直接删除
password: "1234" # if you donot want to set password, you can delete this line, default is empty 默认是空,可直接删除
# 现在必须开启tags选项否则会报错
tags:
- test # tags for post
- web # add more tags if you want
---
Contents Below

View File

@@ -1,6 +1,6 @@
{
"name": "share-to-notionnext",
"version": "0.0.2",
"version": "0.0.5",
"type": "module",
"description": "This is a plugin for Obsidian. This plugin share obsidian md file to notion with notion api for NotionNext web deploy.",
"main": "main.js",