forked from mohuishou/notion-blog-actions
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathaction.yml
106 lines (104 loc) · 3.97 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: 'notion2markdown-action'
description: |
将 notion database 中的 page 转换为 markdown 文档, 可以用于 hexo、hugo 等静态博客构建, 内置picgo-core,使用picBed上传图床。
inputs:
notion_secret: # id of input
description: notion app token, 建议最好放到 Action Secret 中
required: true
database_id:
required: true
description: |
notion 中的数据库 id
- 假设你的数据库页面链接是 `https://www.notion.so/you-name/0f3d856498ca4db3b457c5b4eeaxxxxx`
- 那么 `database_id=0f3d856498ca4db3b457c5b4eeaxxxxx`
status_name:
required: false
description: notion database 状态字段的字段名, 默认为pstatus, 可修改
default: "pstatus"
status_published:
required: false
description: notion database 文章已发布状态的字段值
default: "已发布"
output_page_dir:
required: false
description: page类型页面的输出文件夹
default: "source/"
output_post_dir:
required: false
description: post类型页面的输出文件夹
default: "source/_posts/notion"
clean_unpublished_post:
required: false
description: 是否清除未发表的post
default: "false"
metas_keeped:
required: false
description: |
转换后markdown文件中需要保留的字段, 字段值会同步到Notion中。
例如abbrlink等字段, 在notion->markdown过程不存在, 但需要hexo等博客自动生成, 且不能变化。
多个key请用逗号分隔, 如abbrlink, id
default: "abbrlink"
metas_excluded:
default: "ptype,pstatus"
description: |
Notion转Markdown, 生成页面YAML是需要删除的属性名称, 多个用逗号分隔
需要删除的页面属性名称
last_sync_datetime:
required: false
description: |
上次同步Notion数据库的时间, 用于增量同步, 例如: 2023-09-04T17:21:33+00:00, 务必采用moment.js能够解析的格式
建议采用git中最新一次notion同步的commit时间, 例如: `git log -n 1 --grep="NotionSync" --format="%aI"`
default: ""
pic_migrate:
required: false
description: |
是否迁移图片到图床
注意: 如果不迁移图片默认导出图片链接是 notion 的自带链接, 有访问时效
目前支持迁移图片到多类图床中, 采用的是PicGO-Core.
default: "false"
pic_bed_config:
description: |
picgo-core中picBed配置文件, 支持多类型图床。
example:
```
"current": "smms",
"uploader": "smms", // 代表当前的默认上传图床为 SM.MS,
"smms": {
"token": "" // 从 https://sm.ms/home/apitoken 获取的 token
}
"aliyun":{
"accessKeyId": "",
"accessKeySecret": "",
"bucket": "", // 存储空间名
"area": "", // 存储区域代号
"path": "", // 自定义存储路径
"customUrl": "", // 自定义域名, 注意要加 http://或者 https://
"options": "" // 针对图片的一些后缀处理参数 PicGo 2.2.0+ PicGo-Core 1.4.0+
},
"tcyun":{
"secretId": "",
"secretKey": "",
"bucket": "", // 存储桶名, v4 和 v5 版本不一样
"appId": "",
"area": "", // 存储区域, 例如 ap-beijing-1
"path": "", // 自定义存储路径, 比如 img/
"customUrl": "", // 自定义域名, 注意要加 http://或者 https://
"version": "v5" | "v4" // COS 版本, v4 或者 v5
}
```
详见: https://picgo.github.io/PicGo-Core-Doc/zh/guide/config.html#%E6%89%8B%E5%8A%A8%E7%94%9F%E6%88%90
default: "{}"
pic_compress:
description: |
是否开启图片压缩? true为开启, 默认不开启
default: "false"
timezone:
description: 设置的时区
default: ""
outputs:
updated_count:
description: |
更新的页面数量
runs:
using: 'node16'
main: 'dist/index.js'