jekyll-notion 1.1.0 → 1.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 043b3ae753a651d756c95dc6372af86589106030dd3d41d8b886ccc95c5d5d7a
4
- data.tar.gz: 5a6bf3508185e27978836cd1158ef70a080d53be183c642d7948015f6d7de215
3
+ metadata.gz: d06d0e87707f04d3125126bc7b801c38b6d25aa047ccea5074c567de5504c166
4
+ data.tar.gz: cb581ec500f718c21156eacdffbd3b77368254573de4bfc891f5e074aea8d811
5
5
  SHA512:
6
- metadata.gz: 74e147fe3f6f91a88bafb24f273284bb71d42f39f207c48f85577229aebb6ceb6de6cbe331b48e6f99afb6191466e9f27d436fb45bc710104a0ac3a80e016c6c
7
- data.tar.gz: 2257337e331db87e4594e5117739ea7e1082739b3f497a4c63bba7f2dc79d2c173a484fc574ea20eb40d8650c14c84a607c9e17cef9f49174ff97bf79edab73e
6
+ metadata.gz: d4acb7a0293e3136b7ef128e3881c2683dc81c9daa56ce1f5659fdae146b117014a25660c394b692995d7b86bc0d06f2b2aeeccc1179c4571d035cbeb232c868
7
+ data.tar.gz: fd462f54aaebbbf8fdfa925653b74b2443603ff10a7fb8c25b38dc63bea4f13fb261fcfb619c8e0f84d7974c1e2f5ae3a69ff0489bf817c2bacc7dd71a094381
@@ -6,6 +6,7 @@ module JekyllNotion
6
6
  @site.data[@db.data] = data
7
7
  # Caching current data
8
8
  @plugin.data[@db.data] = data
9
+ log_pages
9
10
  end
10
11
 
11
12
  private
@@ -13,5 +14,12 @@ module JekyllNotion
13
14
  def data
14
15
  @data ||= @db.pages.map(&:props)
15
16
  end
17
+
18
+ def log_pages
19
+ @db.pages.each do |page|
20
+ Jekyll.logger.info("Jekyll Notion:", "Page => #{page.title}")
21
+ Jekyll.logger.debug("", "Props => #{page.props.keys.inspect}")
22
+ end
23
+ end
16
24
  end
17
25
  end
@@ -9,10 +9,11 @@ module JekyllNotion
9
9
 
10
10
  return unless notion_token? && config?
11
11
 
12
- if fetch_on_watch? || collections.empty?
12
+ if fetch_on_watch? || collections_and_data_empty?
13
13
  read_notion_database
14
14
  else
15
15
  collections.each_pair { |key, val| @site.collections[key] = val }
16
+ data.each_pair { |key, val| @site.data[key] = val }
16
17
  end
17
18
  end
18
19
 
@@ -30,6 +31,10 @@ module JekyllNotion
30
31
 
31
32
  protected
32
33
 
34
+ def collections_and_data_empty?
35
+ collections.empty? && data.empty?
36
+ end
37
+
33
38
  def read_notion_database
34
39
  databases.each do |db_config|
35
40
  db = NotionDatabase.new(:config => db_config)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JekyllNotion
4
- VERSION = "1.1.0"
4
+ VERSION = "1.1.1"
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: 1.1.0
4
+ version: 1.1.1
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-02-26 00:00:00.000000000 Z
11
+ date: 2022-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll