jekyll-dotenv 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +16 -2
- data/lib/jekyll/dotenv.rb +14 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 764425c6112ebdde3f9082de8fa8bc252282bb724fa6d220adef1628404a94e1
|
4
|
+
data.tar.gz: 4cc1d07a8913bcdb021f6ccbdeb0c2790d3f1920eaf8736d630bd06a2ae577e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1ef4d63460e1d58fe18bb607711dda7ad89a588917e76d1f74f0cec1cb9005818b4fd34d414cfbe667c3bb1d3d1e62f34329c0b7d856e90f22e2daa964d88ef
|
7
|
+
data.tar.gz: 0e22841735c91bbb2096ec73174891906eb36e8e64b8e40194b8393158c2feca4c8fb80dbf95df942ec7dbccb1220a36a5164d3a58bf01f40a93e3457eed77ac
|
data/README.md
CHANGED
@@ -49,6 +49,20 @@ Use in a theme:
|
|
49
49
|
{{ site.env.SOME_KEY }}
|
50
50
|
```
|
51
51
|
|
52
|
+
## Advanced
|
53
|
+
|
54
|
+
You can create hashes from environment variables like this:
|
55
|
+
|
56
|
+
```bash
|
57
|
+
WEBMASTER_VERIFICATIONS.GOOGLE="something"
|
58
|
+
WEBMASTER_VERIFICATIONS.FACEBOOK="something"
|
59
|
+
```
|
60
|
+
|
61
|
+
They will be available in Liquid as
|
62
|
+
`site.env.WEBMASTER_VERIFICATIONS.GOOGLE` **and** as
|
63
|
+
`site.webmaster_verifications.google`, which makes jekyll-seo-tag get
|
64
|
+
its configuration from the environment.
|
65
|
+
|
52
66
|
## Attention
|
53
67
|
|
54
68
|
Be aware that your environment variables may contain personal
|
@@ -58,8 +72,8 @@ not be fit to be dumped whole as JSON.
|
|
58
72
|
## Contributing
|
59
73
|
|
60
74
|
Bug reports and pull requests are welcome on 0xacab.org at
|
61
|
-
<https://0xacab.org/sutty/jekyll/jekyll-dotenv>. This
|
62
|
-
|
75
|
+
<https://0xacab.org/sutty/jekyll/jekyll-dotenv>. This project is
|
76
|
+
intended to be a safe, welcoming space for collaboration, and
|
63
77
|
contributors are expected to adhere to the [Sutty code of
|
64
78
|
conduct](https://sutty.nl/en/code-of-conduct/).
|
65
79
|
|
data/lib/jekyll/dotenv.rb
CHANGED
@@ -4,4 +4,18 @@ require 'dotenv/load'
|
|
4
4
|
|
5
5
|
Jekyll::Hooks.register :site, :after_init, priority: :high do |site|
|
6
6
|
site.config['env'] = ENV.to_h
|
7
|
+
|
8
|
+
split_keys =
|
9
|
+
site.config['env'].map do |key, value|
|
10
|
+
key.downcase.split('.').reverse.inject(value) do |v, h|
|
11
|
+
{ h => v }
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
merged_keys =
|
16
|
+
split_keys.reduce do |m, c|
|
17
|
+
Jekyll::Utils.deep_merge_hashes m, c
|
18
|
+
end
|
19
|
+
|
20
|
+
site.config.merge merged_keys
|
7
21
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-dotenv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- f
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01-
|
11
|
+
date: 2021-01-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|