jekyll-notion 0.0.0 → 0.0.1

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: 72643f8e9760b1f45a30fd87a8448cf16b1f85a63bcec6c83b4d4b3dea8b4c21
4
- data.tar.gz: 95b0c61bdfc5e7c6dc018798474dcd40e6ec0728c0836d552249b9b7da8213bf
3
+ metadata.gz: 7d1ccb2f2f5451b3eaf6d80dd8f8fed62cd2d5fd582d1cce09fbf10a494b54ac
4
+ data.tar.gz: f651dd2f6e3c5404b33af0abdb11274eacc34296c6301e9d79d76f38ccb8f1e6
5
5
  SHA512:
6
- metadata.gz: daf22fba12e6385aaa5842103c390ee6f58c093bf5ee1b199700c769a45d7736f04600f71cc0bcdedd77018a547024f8bdaf517a842cd88d58f13af4a77d57c9
7
- data.tar.gz: 4d28a3d8319345e1a936ac3112009568a1d693cbd3314783fdea12d4c1cca38da33f701b25d870eb1cebf0fc11347f849979fcfee94a9d98173d33e376e50bec
6
+ metadata.gz: f87ce41674b28e289e7b69a0d4a40ac64fc0c9e9384ce5fdfb9b82312ba439ba60c5b7bab2a8ead2d1075adffd4a852bbae7534acc67d5317221c5fe236b52bf
7
+ data.tar.gz: 9ac472cd2c48b0affd89825b8d08a11fb8e562ac8da05193111bcc85f219196352345f4c6ebd6ff0b9721c847f00e30fc0820190fa8dd6950758355b24aafbd5
data/README.md CHANGED
@@ -68,6 +68,8 @@ date: created_time
68
68
  ---
69
69
  ```
70
70
 
71
+ Any property provided in the frontmatter config that matches a default property will be overwritten by the default value.
72
+
71
73
  ## Page filename
72
74
 
73
75
  There are two kinds of collections: posts and others.
@@ -36,19 +36,26 @@ module JekyllNotion
36
36
  end
37
37
 
38
38
  def make_frontmatter
39
+ data = Jekyll::Utils.deep_merge_hashes(config_frontmatter, notion_frontmatter)
40
+ page_frontmatter = data.to_a.map { |k, v| "#{k}: #{v}" }.join("\n")
39
41
  <<~CONTENT
40
42
  ---
41
- id: #{current_page.id}
42
- title: #{current_page.title}
43
- date: #{current_page.created_datetime}
44
- cover: #{current_page.cover}
45
- #{frontmatter}
43
+ #{page_frontmatter}
46
44
  ---
47
45
  CONTENT
48
46
  end
49
47
 
50
- def frontmatter
51
- config.dig("database", "frontmatter").to_a.map { |k, v| "#{k}: #{v}" }.join("\n")
48
+ def notion_frontmatter
49
+ {
50
+ :id => current_page.id,
51
+ :title => current_page.title,
52
+ :date => current_page.created_datetime,
53
+ :cover => current_page.cover,
54
+ }
55
+ end
56
+
57
+ def config_frontmatter
58
+ config.dig("database", "frontmatter") || {}
52
59
  end
53
60
 
54
61
  def make_filename
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JekyllNotion
4
- VERSION = "0.0.0"
4
+ VERSION = "0.0.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: 0.0.0
4
+ version: 0.0.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-01-19 00:00:00.000000000 Z
11
+ date: 2022-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport