Skip to main content

Convert hexo to notionnext

Project description

hexo2notionnext

一个简单的 hexo 导入到 NotionNext database 的脚本

当然,下面是一个适用于您的Hexo数据导入到Notion的开源库的Readme示例:

Hexo to NotionNext

该项目是一个用于将基于Hexo的博客文章导入到Notion的开源库。它使用Python和Notion API来实现导入。该项目旨在帮助将现有的Hexo博客文章迁移到 NotionNext 中。

准备工作

在使用此库之前,您需要完成以下准备工作:

  1. NotionNext Database 准备工作参看 https://tangly1024.com/article/vercel-deploy-notion-next

  2. Hexo 博客的 _post 目录

  3. clone 库到本地,并安装项目依赖

git clone git@github.com:zhangweidev/hexo2notionnext.git
cd hexo2notionnext 
pip install -r requirements.txt 

使用

在安装完库之后,需要修改配置文件 config.yaml 的配置

token_v2: <your_token>
database_url: <your_notion_database_url>"
hexo_post_path: <your_hexo_post_path>
sulg_format: ':year-:day-:month-:name'

token_v2 : notion.so cookie 中 token_v2 的值 database_url: notionNext 页面的地址,如果没有 Duplicate 到自己的 notion 中. hexo_post_path: 本地 Hexo 目录 的 source/_posts 目录 sulg_format: 路径的格式,参考 https://hexo.io/zh-cn/docs/permalinks ,不支持 :id,

例如:

token_v2: ARoF7YRLnZOB0vvU2eLBIzf1TEh_b9sf76ZH7m2Xq0fV-FH9tqiE4LGKag2gXM9YVDR7fo-qZz8HWhxjFzI2KM1IA 
database_url: https://tanghh.notion.site/02ab3b8678004aa69e9e415905ef32a5?v=b7eb215720224ca5827bfaa5ef82cf2d
hexo_post_path: /Users/zhangwei/Documents/hexo/source/_posts
sulg_format: ':year-:day-:month-:name'

配置完成后,使用以下命令将Hexo文章导入到Notion中:

python hexo2notionnext.py 

也可以指定配置文件

python hexo2notionnext.py  -c config.yaml 

问题

  • For those getting 'HTTPError( requests.exceptions.HTTPError: Invalid input.)' 出现这个问题
  1. 在终端上运行 pip show notion
  2. 获取 notion 包位置并访问其内容(例如/usr/local/lib/python3.9/site-packages/notion )。
  3. store.py 第 280 行更改为 limit: 100 https://github.com/paperboi/kindle2notion/issues/14

感谢

https://github.com/Cobertos/md2notion https://github.com/jamalex/notion-py

许可证

The MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hexo2notionnext-0.0.1.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

hexo2notionnext-0.0.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file hexo2notionnext-0.0.1.tar.gz.

File metadata

  • Download URL: hexo2notionnext-0.0.1.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for hexo2notionnext-0.0.1.tar.gz
Algorithm Hash digest
SHA256 51a796c5e8bfd61be5bde70c810d9d496598706814f7036c184375a0e78d4357
MD5 44c6e1b52c84aa4a21b44fc1673430a8
BLAKE2b-256 4c64736f6fd5f737efda3f3b486fe87f64e9931e0826de6374f0414d5dd921e7

See more details on using hashes here.

File details

Details for the file hexo2notionnext-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for hexo2notionnext-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7d2938aac2b48cada744f93f3fe9738c23db2dfc44824f937c1b2bc0d6d4c682
MD5 6d4fbc42ee078b3b3ceb458ae57e123d
BLAKE2b-256 fff47cd3359f493046bc4e58babb49fb1cb178c9a5a4d5e2fd69353b5dcaa35e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page