jekyll-locales 0.2.0 → 0.3.0rc0
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/jekyll-locales.gemspec +2 -0
- data/lib/jekyll/locales/site.rb +43 -2
- data/lib/jekyll/locales/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +33 -6
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f668c6aa02d494fba7095d17c67c8ddb174880fe49e0a1bf2539b87aa7b76052
|
4
|
+
data.tar.gz: 99bc10ba30dc7d49ed82363c1d400e1dae2d9d8e2e2d68878d24e5e88e46817f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1b4b658762aa1bc3cd096e0debc31547017dc61cc0fddd48fdd848146c0ab5b8df4a5883f8606a67b5d37fc4b3c01351c5e5165cebb5f2bd99f3f8068007926
|
7
|
+
data.tar.gz: 8f5f076a341f854c6502ffd5d7615d03d3ce0378027949104ed693f670c12a775e861c6558464d444f0e9af7008564139b7693168138d1449afd5a4f224d87de
|
checksums.yaml.gz.sig
ADDED
Binary file
|
data/jekyll-locales.gemspec
CHANGED
@@ -18,6 +18,8 @@ Gem::Specification.new do |spec|
|
|
18
18
|
DESCRIPTION
|
19
19
|
spec.homepage = 'https://0xacab.org/sutty/jekyll/jekyll-locales'
|
20
20
|
spec.license = 'GPL-3.0'
|
21
|
+
spec.cert_chain = [File.expand_path('~/gem-public_cert.pem')]
|
22
|
+
spec.signing_key = File.expand_path('~/gem-private_key.pem')
|
21
23
|
|
22
24
|
spec.metadata['homepage_uri'] = spec.homepage
|
23
25
|
spec.metadata['source_code_uri'] = spec.homepage
|
data/lib/jekyll/locales/site.rb
CHANGED
@@ -1,6 +1,27 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'digest'
|
4
|
+
|
3
5
|
module Jekyll
|
6
|
+
# Calculate the config changes based on the _config.yml digest instead
|
7
|
+
# of the contents.
|
8
|
+
class Cache
|
9
|
+
class << self
|
10
|
+
def clear_if_config_changed(_)
|
11
|
+
config = Digest::SHA2.file('_config.yml').hexdigest
|
12
|
+
cache = Jekyll::Cache.new "Jekyll::Cache"
|
13
|
+
return if cache.key?("config_digest") && cache["config_digest"] == config
|
14
|
+
|
15
|
+
Jekyll.logger.warn 'Cache:', 'Config changed, clearing caches'
|
16
|
+
|
17
|
+
clear
|
18
|
+
cache = Jekyll::Cache.new "Jekyll::Cache"
|
19
|
+
cache["config_digest"] = Digest::SHA2.file('_config.yml').hexdigest
|
20
|
+
nil
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
4
25
|
# Jekyll multilingual support
|
5
26
|
#
|
6
27
|
# * Posts are put under _LANGUAGE/ directories
|
@@ -21,6 +42,7 @@ module Jekyll
|
|
21
42
|
|
22
43
|
Jekyll.logger.info 'Generating locale:', locale
|
23
44
|
|
45
|
+
locale_create
|
24
46
|
locale_config
|
25
47
|
|
26
48
|
Jekyll.logger.info 'Destination:', config['destination']
|
@@ -44,6 +66,9 @@ module Jekyll
|
|
44
66
|
# If we enable the redirector, the root of the site will consist
|
45
67
|
# of an index.html that allows visitors to select their locale.
|
46
68
|
copy_redirector if redirect?
|
69
|
+
|
70
|
+
# Remove _posts symlink
|
71
|
+
posts_delete
|
47
72
|
end
|
48
73
|
|
49
74
|
def locales?
|
@@ -138,8 +163,8 @@ module Jekyll
|
|
138
163
|
# Creates a symlink to the _posts/ directory so Jekyll believes
|
139
164
|
# it's processing a single site.
|
140
165
|
def symlink
|
141
|
-
|
142
|
-
FileUtils.ln_s(
|
166
|
+
posts_delete
|
167
|
+
FileUtils.ln_s(locale_dir, in_source_dir('_posts'))
|
143
168
|
end
|
144
169
|
|
145
170
|
def redirect?
|
@@ -194,5 +219,21 @@ module Jekyll
|
|
194
219
|
FileUtils.ln_s File.join(rel, child), File.join(dst, child)
|
195
220
|
end
|
196
221
|
end
|
222
|
+
|
223
|
+
def posts_delete
|
224
|
+
FileUtils.rm_f in_source_dir('_posts')
|
225
|
+
end
|
226
|
+
|
227
|
+
def locale_dir
|
228
|
+
"_#{locale}"
|
229
|
+
end
|
230
|
+
|
231
|
+
def absolute_locale_dir
|
232
|
+
in_source_dir locale_dir
|
233
|
+
end
|
234
|
+
|
235
|
+
def locale_create
|
236
|
+
FileUtils.mkdir_p absolute_locale_dir
|
237
|
+
end
|
197
238
|
end
|
198
239
|
end
|
data.tar.gz.sig
ADDED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-locales
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0rc0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- f
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
|
-
cert_chain:
|
11
|
-
|
10
|
+
cert_chain:
|
11
|
+
- |
|
12
|
+
-----BEGIN CERTIFICATE-----
|
13
|
+
MIIEYDCCAsigAwIBAgIBATANBgkqhkiG9w0BAQsFADA7MQ4wDAYDVQQDDAVmYXVu
|
14
|
+
bzEVMBMGCgmSJomT8ixkARkWBXN1dHR5MRIwEAYKCZImiZPyLGQBGRYCbmwwHhcN
|
15
|
+
MjUwMTA3MTczMTQ1WhcNMjYwMTA3MTczMTQ1WjA7MQ4wDAYDVQQDDAVmYXVubzEV
|
16
|
+
MBMGCgmSJomT8ixkARkWBXN1dHR5MRIwEAYKCZImiZPyLGQBGRYCbmwwggGiMA0G
|
17
|
+
CSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQDqrFZ8PCNQbaW1incHEZp/OZTIt7bZ
|
18
|
+
TM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JknP+xeAg8wt2wT+IC1X1
|
33
|
+
zMY8gjxoBfwPum74cBTaZzYMpeGaS1fJ3N4NBU+SHLRDiKaVZzEnoNyJDHnsXXrX
|
34
|
+
MvF98+bTUHC9xcklH7RCO5uqUOq7cxIcMjzx3cpR6+AW6zXYQBjWfNB9KfaAstZy
|
35
|
+
cpurTQHNJfL/ah+9dYbgDXdG5HAAjRMAsWSvERw95YdN9XzQZCdUk5wUs+A6cNtO
|
36
|
+
AZZUMTVYNx8JqUeemxlXBRjsD/s=
|
37
|
+
-----END CERTIFICATE-----
|
38
|
+
date: 2025-03-14 00:00:00.000000000 Z
|
12
39
|
dependencies:
|
13
40
|
- !ruby/object:Gem::Dependency
|
14
41
|
name: bundler
|
@@ -113,11 +140,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
113
140
|
version: '0'
|
114
141
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
142
|
requirements:
|
116
|
-
- - "
|
143
|
+
- - ">"
|
117
144
|
- !ruby/object:Gem::Version
|
118
|
-
version:
|
145
|
+
version: 1.3.1
|
119
146
|
requirements: []
|
120
|
-
rubygems_version: 3.3.
|
147
|
+
rubygems_version: 3.3.27
|
121
148
|
signing_key:
|
122
149
|
specification_version: 4
|
123
150
|
summary: Jekyll plugin for localized sites
|
metadata.gz.sig
ADDED
Binary file
|