jekyll-notion 2.4.2 → 2.4.4

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: '088ab1c8e851aa22893826c0ad7c23b54bf6272595b58371b341d9073e3c8808'
4
- data.tar.gz: 712a657a2093e556dffdada517ddcb6374254e191e9be84582d4393a69359268
3
+ metadata.gz: e44e3ab5a282cedcb01589e19fa93a7431123eda2ced53c3a0dd557f46cae968
4
+ data.tar.gz: cc3f9c5a136cf4e763680ae96cbd916c654c95f71137c96ffb3fccadf8f93f80
5
5
  SHA512:
6
- metadata.gz: 776ff09d46941bc596613d3968bd940d5be6d0f2a3d523d3825a055a8ffa92206c87e1a3e44ba7e4f541fae137e62a0f1e786b8a727bba3cc12936511747111c
7
- data.tar.gz: 0fe8e951359b66becc5515f4c9f30e3060ba60b8d7e4d328f7af3aeed9484bbd9921dccce105c420509511fee486b6484b05533b56840706c905aaf63811d6ba
6
+ metadata.gz: ebc8f23fff22e506f48b1cc91c54d50377bf7305697f3e97870183c1b718545d5bae2125ab9a4f6148895104494a5349931615596d5d7649b0b60bac5288c64c
7
+ data.tar.gz: bb097aa7684dc69f6208d0d6bc373fc4b83d634aff15bfbdcf6595408c5ccd5a548611dcc470cbf024d2efc6a415c297dde94accc1b9653ab1a79beba3ec377a
data/README.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  Import notion pages to jekyll.
4
4
 
5
+ You can learn more about how to use jekyll-notion with the following links:
6
+
7
+ * [Load notion pages in jekyll](https://enrq.me/dev/2022/03/20/load-notion-pages-in-jekyll/)
8
+ * [Managing Jekyll posts in Notion](https://enrq.me/dev/2022/03/24/managing-jekyll-posts-in-notion/)
9
+ * [Embedding videos with jekyll-notion](https://enrq.me/dev/2023/03/31/embedding-videos-with-jekyll-notion/)
10
+
5
11
  ## Installation
6
12
 
7
13
  Use gem to install.
@@ -15,6 +21,9 @@ Or add it to the `Gemfile`.
15
21
  gem 'jekyll-notion'
16
22
  ```
17
23
 
24
+ > [!IMPORTANT]
25
+ > When using jekyll-archives, make sure that jekyll-notion is placed before jekyll-archives in the gemfile. Otherwise pages imported by jekyll-notion won't be collected by jekyll-archives. More info [here](https://github.com/emoriarty/jekyll-notion/issues/95#issuecomment-2732112458).
26
+
18
27
  And update your jekyll plugins property in `_config.yml`.
19
28
 
20
29
  ```yml
@@ -146,7 +155,9 @@ Notice, the page body is stored in the key `content`.
146
155
 
147
156
  The rest of properties are mapped as expected. For more info go to [notion properties](#notion-properties).
148
157
 
149
- ### Watch
158
+ ### Watch (Deprecated)
159
+
160
+ _Use the cache mechanism instead._
150
161
 
151
162
  By default, databases are only requested during the first build. Subsequent builds use the results from the cache.
152
163
 
@@ -9,7 +9,7 @@ module JekyllNotion
9
9
  VCR.configure do |config|
10
10
  config.cassette_library_dir = cache_path(cache_dir)
11
11
  config.hook_into :faraday # Faraday is used by notion-ruby-client gem
12
- config.filter_sensitive_data("<NOTION_TOKEN>") { ENV["NOTION_TOKEN"] }
12
+ config.filter_sensitive_data("<NOTION_TOKEN>") { ENV.fetch("NOTION_TOKEN", nil) }
13
13
  config.allow_http_connections_when_no_cassette = true
14
14
  config.default_cassette_options = {
15
15
  :allow_playback_repeats => true,
@@ -75,6 +75,9 @@ module JekyllNotion
75
75
  end
76
76
 
77
77
  def fetch_on_watch?
78
+ Jekyll.logger.warn("Jekyll Notion:",
79
+ "[Warning] The fetch_on_watch feature is deprecated in preference to the cache mechanism. It will be removed in the next major release.")
80
+
78
81
  config["fetch_on_watch"] == true
79
82
  end
80
83
 
@@ -64,11 +64,11 @@ module JekyllNotion
64
64
  def date_for(page)
65
65
  # The "date" property overwrites the Jekyll::Document#data["date"] key
66
66
  # which is the date used by Jekyll to set the post date.
67
- DateTime.parse(page.props["date"]).to_date
67
+ Time.parse(page.props["date"]).to_date
68
68
  rescue TypeError, NoMethodError
69
69
  # Because the "date" property is not required,
70
70
  # it fallbacks to the created_time which is always present.
71
- page.created_time.to_date
71
+ Time.parse(page.created_time).to_date
72
72
  end
73
73
  end
74
74
  end
@@ -31,7 +31,7 @@ module JekyllNotion
31
31
  converter.convert(output)
32
32
  rescue StandardError => e
33
33
  Jekyll.logger.error "Conversion error:",
34
- "#{converter.class} encountered an error while "\
34
+ "#{converter.class} encountered an error while " \
35
35
  "converting notion page '#{page.title}':"
36
36
  Jekyll.logger.error("", e.to_s)
37
37
  raise e
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JekyllNotion
4
- VERSION = "2.4.2"
4
+ VERSION = "2.4.4"
5
5
  end
data/lib/jekyll-notion.rb CHANGED
@@ -10,7 +10,7 @@ require "vcr"
10
10
  NotionToMd::Logger.level = Logger::ERROR
11
11
 
12
12
  Notion.configure do |config|
13
- config.token = ENV["NOTION_TOKEN"]
13
+ config.token = ENV.fetch("NOTION_TOKEN", nil)
14
14
  end
15
15
 
16
16
  module JekyllNotion
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.2
4
+ version: 2.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Enrique Arias
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-14 00:00:00.000000000 Z
11
+ date: 2025-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -48,36 +48,30 @@ dependencies:
48
48
  name: notion_to_md
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - ">="
52
- - !ruby/object:Gem::Version
53
- version: '2.0'
54
- - - "<"
51
+ - - "~>"
55
52
  - !ruby/object:Gem::Version
56
- version: '2.4'
53
+ version: 2.5.0
57
54
  type: :runtime
58
55
  prerelease: false
59
56
  version_requirements: !ruby/object:Gem::Requirement
60
57
  requirements:
61
- - - ">="
62
- - !ruby/object:Gem::Version
63
- version: '2.0'
64
- - - "<"
58
+ - - "~>"
65
59
  - !ruby/object:Gem::Version
66
- version: '2.4'
60
+ version: 2.5.0
67
61
  - !ruby/object:Gem::Dependency
68
62
  name: vcr
69
63
  requirement: !ruby/object:Gem::Requirement
70
64
  requirements:
71
65
  - - "~>"
72
66
  - !ruby/object:Gem::Version
73
- version: 6.2.0
67
+ version: 6.3.1
74
68
  type: :runtime
75
69
  prerelease: false
76
70
  version_requirements: !ruby/object:Gem::Requirement
77
71
  requirements:
78
72
  - - "~>"
79
73
  - !ruby/object:Gem::Version
80
- version: 6.2.0
74
+ version: 6.3.1
81
75
  - !ruby/object:Gem::Dependency
82
76
  name: bundler
83
77
  requirement: !ruby/object:Gem::Requirement
@@ -170,7 +164,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
170
164
  requirements:
171
165
  - - ">="
172
166
  - !ruby/object:Gem::Version
173
- version: 2.5.0
167
+ version: 2.7.0
174
168
  required_rubygems_version: !ruby/object:Gem::Requirement
175
169
  requirements:
176
170
  - - ">="