jekyll-notion 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +15 -30
- data/lib/jekyll-notion/document_without_a_file.rb +1 -1
- data/lib/jekyll-notion/generator.rb +11 -2
- data/lib/jekyll-notion/notion_database.rb +2 -2
- data/lib/jekyll-notion/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e351ae1ce9e4d8b720d052833dd6aafac27a32f39c31997f905daa32a07dcee3
|
4
|
+
data.tar.gz: 81346fb1c4978038e30fd53e3b9f63593e6619eac308ad77fcf261fd50cd33e8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea596442ebf4c76a03192ddab3bf6a785de225aeb6fb35c2c642f8b5026e93a4b559d99f5789b5c9e7bae66bbf1ef959cb952480f4624968bc335065c507eabd
|
7
|
+
data.tar.gz: b073d9dd0b6032fd323f98002aa2a5202fda0713b027908e2dc7f76541264ae92a4f3fbccb69f93c8c1a4b6c48d87bbf7b1415254ed92772fe3d42be07ef38b0
|
data/README.md
CHANGED
@@ -34,17 +34,17 @@ $ export NOTION_TOKEN=<secret_...>
|
|
34
34
|
|
35
35
|
### Databases
|
36
36
|
|
37
|
-
Once
|
37
|
+
Once the [notion database](https://www.notion.so/help/intro-to-databases) has been shared, specify the database `id` in the `_config.yml` file as follows.
|
38
38
|
|
39
39
|
```yml
|
40
40
|
notion:
|
41
|
-
|
42
|
-
id: 5cfed4de3bdc4f43ae8ba653a7a2219b
|
41
|
+
databases:
|
42
|
+
- id: 5cfed4de3bdc4f43ae8ba653a7a2219b
|
43
43
|
```
|
44
44
|
|
45
45
|
By default, the notion pages contained in the database will be loaded into the `posts` collection.
|
46
46
|
|
47
|
-
|
47
|
+
We can also define __multiple databases__ as follows.
|
48
48
|
|
49
49
|
```yml
|
50
50
|
collections:
|
@@ -73,11 +73,11 @@ Each dabatase support the following options.
|
|
73
73
|
|
74
74
|
```yml
|
75
75
|
notion:
|
76
|
-
|
77
|
-
id: e42383cd49754897b967ce453760499f
|
78
|
-
|
79
|
-
|
80
|
-
|
76
|
+
databases:
|
77
|
+
- id: e42383cd49754897b967ce453760499f
|
78
|
+
collection: posts
|
79
|
+
filter: { "property": "Published", "checkbox": { "equals": true } }
|
80
|
+
sorts: [{ "timestamp": "created_time", "direction": "ascending" }]
|
81
81
|
```
|
82
82
|
|
83
83
|
### Pages
|
@@ -86,8 +86,8 @@ Individual Notion pages can also be loaded into Jekyll. Just define the `page` p
|
|
86
86
|
|
87
87
|
```yml
|
88
88
|
notion:
|
89
|
-
|
90
|
-
id: 5cfed4de3bdc4f43ae8ba653a7a2219b
|
89
|
+
pages:
|
90
|
+
- id: 5cfed4de3bdc4f43ae8ba653a7a2219b
|
91
91
|
```
|
92
92
|
|
93
93
|
As databases, we can set up multiple pages.
|
@@ -122,7 +122,7 @@ notion:
|
|
122
122
|
|
123
123
|
Page properties and body of the notion page are stored as a hash object.
|
124
124
|
|
125
|
-
|
125
|
+
Data objects can be accessed as follows.
|
126
126
|
|
127
127
|
```html
|
128
128
|
<ul>
|
@@ -149,30 +149,15 @@ Set `fetch_on_watch` to true to allow request on each rebuild.
|
|
149
149
|
```yml
|
150
150
|
notion:
|
151
151
|
fetch_on_watch: true
|
152
|
-
|
153
|
-
id: e42383cd49754897b967ce453760499f
|
152
|
+
databases:
|
153
|
+
- id: e42383cd49754897b967ce453760499f
|
154
154
|
```
|
155
155
|
|
156
156
|
And that's all. Each page in the notion database will be included in the selected collection.
|
157
157
|
|
158
158
|
## Notion properties
|
159
159
|
|
160
|
-
|
161
|
-
|
162
|
-
Notion page properties are `id`, `title`, `created_time`, `last_edited_time`, `icon`, `cover` and `archived`.
|
163
|
-
|
164
|
-
```
|
165
|
-
---
|
166
|
-
id: e42383cd-4975-4897-b967-ce453760499f
|
167
|
-
title: An amazing post
|
168
|
-
cover: https://img.bank.sh/an_image.jpg
|
169
|
-
date: 2022-01-23T12:31:00.000Z
|
170
|
-
icon: 💥
|
171
|
-
archived: false
|
172
|
-
---
|
173
|
-
```
|
174
|
-
|
175
|
-
In addition to default properties, custom properties are also appended to front matter.
|
160
|
+
Notion page properties are set for each document in the front matter.
|
176
161
|
|
177
162
|
Please, refer to the [notion_to_md](https://github.com/emoriarty/notion_to_md/) gem to learn more.
|
178
163
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module JekyllNotion
|
4
4
|
class DocumentWithoutAFile < Jekyll::Document
|
5
|
-
def read_content(
|
5
|
+
def read_content(**_opts)
|
6
6
|
if content =~ YAML_FRONT_MATTER_REGEXP
|
7
7
|
self.content = Regexp.last_match.post_match
|
8
8
|
data_file = SafeYAML.load(Regexp.last_match(1))
|
@@ -20,11 +20,20 @@ module JekyllNotion
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def config_databases
|
23
|
-
|
23
|
+
if config["database"]
|
24
|
+
Jekyll.logger.warn("Jekyll Notion:",
|
25
|
+
"database property is deprecated, use databases instead.")
|
26
|
+
end
|
27
|
+
|
28
|
+
config["databases"] || []
|
24
29
|
end
|
25
30
|
|
26
31
|
def config_pages
|
27
|
-
|
32
|
+
if config["page"]
|
33
|
+
Jekyll.logger.warn("Jekyll Notion:",
|
34
|
+
"page property is deprecated, use pages instead.")
|
35
|
+
end
|
36
|
+
config["pages"] || []
|
28
37
|
end
|
29
38
|
|
30
39
|
def collections
|
@@ -17,9 +17,9 @@ module JekyllNotion
|
|
17
17
|
|
18
18
|
def sorts
|
19
19
|
if config["sort"]
|
20
|
-
Jekyll.logger.warn("Jekyll Notion:", "sort property
|
20
|
+
Jekyll.logger.warn("Jekyll Notion:", "sort property is deprecated, use sorts instead")
|
21
21
|
end
|
22
|
-
config["sorts"]
|
22
|
+
config["sorts"]
|
23
23
|
end
|
24
24
|
|
25
25
|
def collection_name
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-notion
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Enrique Arias
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-07-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -100,6 +100,20 @@ dependencies:
|
|
100
100
|
- - "~>"
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
version: 0.12.0
|
103
|
+
- !ruby/object:Gem::Dependency
|
104
|
+
name: simplecov
|
105
|
+
requirement: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 0.21.0
|
110
|
+
type: :development
|
111
|
+
prerelease: false
|
112
|
+
version_requirements: !ruby/object:Gem::Requirement
|
113
|
+
requirements:
|
114
|
+
- - "~>"
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: 0.21.0
|
103
117
|
description:
|
104
118
|
email:
|
105
119
|
- emoriarty81@gmail.com
|