jekyll-notion 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 79520a9f4d598b024d2934fd68140f0f34775e2611ff601b1352ba60f67e9dd3
4
- data.tar.gz: bcd325965c4eec49a498fe99c2101fa238f6c67587cb13723927abe0b8e83c1f
3
+ metadata.gz: d730d8b3c38a4857f9a506b6219aeba97b31f9257fb6c6ecfefe5fe2c30e921c
4
+ data.tar.gz: 7ce7ce2738857027a3b2f48fc5b237b1e4725963d9a2a5273a12c92ba41477f0
5
5
  SHA512:
6
- metadata.gz: 17ca3742b0b48a22dd7cca185c25f9368565e7af35ccdc3e9add259faa20aa101e908aac961363c1ecf2b0d2f6822153e6b7d4a6bc53a3dc1d49697cb1199bc1
7
- data.tar.gz: 0a46f5e5ce29f09bc1966ac4199a080da5eea58cedcaa37062cf5fd3bc77b35a8ad45bbf1067d01d32ca9094e53e36e21223187b8c3d94970ef092eb09ca56d0
6
+ metadata.gz: cc4d474362dd91a1308a917654d725151877f81f348c768211aa272a265233e3af82119d47e75209e3aaeb205207a15a325a8795e18d2a4fd8c27ead79f947d8
7
+ data.tar.gz: bcf4276e64b3d2176a015b8ab81ced2d4f4e3cc2e8a2755f4a54502d1b0b28c6d43ca234b55d55765572d7c36ee69986f132475c4c200a052c2b0171538cf72a
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # jekyll-notion
2
2
 
3
- Import notion pages to a jekyll collection or data.
3
+ Import notion pages to jekyll.
4
4
 
5
5
  ## Installation
6
6
 
@@ -68,8 +68,8 @@ Each dabatase support the following options.
68
68
 
69
69
  * `id`: the notion database unique identifier,
70
70
  * `collection`: the collection each page belongs to (posts by default),
71
- * `filter`: the database query filter,
72
- * `sort`: the database query sort,
71
+ * `filter`: the database [filter property](https://developers.notion.com/reference/post-database-query-filter),
72
+ * `sorts`: the database [sorts criteria](https://developers.notion.com/reference/post-database-query-sort),
73
73
 
74
74
  ```yml
75
75
  notion:
@@ -77,7 +77,7 @@ notion:
77
77
  id: e42383cd49754897b967ce453760499f
78
78
  collection: posts
79
79
  filter: { "property": "Published", "checkbox": { "equals": true } }
80
- sort: { "property": "Last ordered", "direction": "ascending" }
80
+ sorts: [{ "timestamp": "created_time", "direction": "ascending" }]
81
81
  ```
82
82
 
83
83
  ### Pages
@@ -42,7 +42,7 @@ module JekyllNotion
42
42
  protected
43
43
 
44
44
  def cache_empty?
45
- collections.empty? && pages.empty? && data.empty?
45
+ collections.empty? && pages.empty? && data.empty?
46
46
  end
47
47
 
48
48
  def read_notion_databases
@@ -7,7 +7,7 @@ module JekyllNotion
7
7
  return [] unless id?
8
8
 
9
9
  @fetch ||= @notion.database_query(query)[:results].map do |page|
10
- NotionToMd::Page.new(:page => page, :blocks => @notion.block_children(:id => page.id))
10
+ NotionToMd::Page.new(:page => page, :blocks => @notion.block_children(:block_id => page.id))
11
11
  end
12
12
  end
13
13
 
@@ -15,8 +15,11 @@ module JekyllNotion
15
15
  config["filter"]
16
16
  end
17
17
 
18
- def sort
19
- config["sort"]
18
+ def sorts
19
+ if config["sort"]
20
+ Jekyll.logger.warn("Jekyll Notion:", "sort property will be deprecated, use sorts instead")
21
+ end
22
+ config["sorts"] || config["sort"]
20
23
  end
21
24
 
22
25
  def collection_name
@@ -30,7 +33,7 @@ module JekyllNotion
30
33
  private
31
34
 
32
35
  def query
33
- { :id => id, :filter => filter, :sort => sort }.compact
36
+ { :database_id => id, :filter => filter, :sorts => sorts }.compact
34
37
  end
35
38
  end
36
39
  end
@@ -6,8 +6,8 @@ module JekyllNotion
6
6
  def fetch
7
7
  return nil unless id?
8
8
 
9
- @fetch ||= NotionToMd::Page.new(:page => @notion.page(query),
10
- :blocks => @notion.block_children(query))
9
+ @fetch ||= NotionToMd::Page.new(:page => @notion.page({ :page_id => id }),
10
+ :blocks => @notion.block_children({ :block_id => id }))
11
11
  end
12
12
 
13
13
  def data_name
@@ -17,11 +17,5 @@ module JekyllNotion
17
17
  def collection_name
18
18
  nil
19
19
  end
20
-
21
- private
22
-
23
- def query
24
- { :id => id }
25
- end
26
20
  end
27
21
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JekyllNotion
4
- VERSION = "2.0.0"
4
+ VERSION = "2.1.0"
5
5
  end
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.0.0
4
+ version: 2.1.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-03-16 00:00:00.000000000 Z
11
+ date: 2022-04-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -36,28 +36,28 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '0'
39
+ version: 1.0.0
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '0'
46
+ version: 1.0.0
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: notion_to_md
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: '1.0'
53
+ version: 1.2.0
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '1.0'
60
+ version: 1.2.0
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: bundler
63
63
  requirement: !ruby/object:Gem::Requirement
@@ -142,8 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
142
  - !ruby/object:Gem::Version
143
143
  version: '0'
144
144
  requirements: []
145
- rubyforge_project:
146
- rubygems_version: 2.7.3
145
+ rubygems_version: 3.1.6
147
146
  signing_key:
148
147
  specification_version: 4
149
148
  summary: A Jekyll plugin to generate pages from Notion