jekyll-locales 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jekyll/locales/site.rb +22 -2
- data/lib/jekyll/locales/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3844ff3bbcd03f8d023d24a5401dd33b5af8a6db56f27671b95f10452dc7ac5d
|
4
|
+
data.tar.gz: f34d64dd27499744a33e0c0003a62cf02e4b69fa14317cf9d81868908708c023
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9217d4a5f0976126ad03ea8f1d2aeae526d1daad4ab67dffe5ee666fd02d6a74f4061bdd15ebfc580614b1b4b81c57369005ad537547c0cef621711c4aaf9be2
|
7
|
+
data.tar.gz: 0e77fe3df350a568a085612fd71ac4bec31c19d7b7c15c9e92d77ecdd94808f78b49901b567a2082cd6f1b84c8b22f07f5b9852856277dd96f5d6e8dce8b9b59
|
data/lib/jekyll/locales/site.rb
CHANGED
@@ -21,6 +21,7 @@ module Jekyll
|
|
21
21
|
|
22
22
|
Jekyll.logger.info 'Generating locale:', locale
|
23
23
|
|
24
|
+
locale_create
|
24
25
|
locale_config
|
25
26
|
|
26
27
|
Jekyll.logger.info 'Destination:', config['destination']
|
@@ -44,6 +45,9 @@ module Jekyll
|
|
44
45
|
# If we enable the redirector, the root of the site will consist
|
45
46
|
# of an index.html that allows visitors to select their locale.
|
46
47
|
copy_redirector if redirect?
|
48
|
+
|
49
|
+
# Remove _posts symlink
|
50
|
+
posts_delete
|
47
51
|
end
|
48
52
|
|
49
53
|
def locales?
|
@@ -138,8 +142,8 @@ module Jekyll
|
|
138
142
|
# Creates a symlink to the _posts/ directory so Jekyll believes
|
139
143
|
# it's processing a single site.
|
140
144
|
def symlink
|
141
|
-
|
142
|
-
FileUtils.ln_s(
|
145
|
+
posts_delete
|
146
|
+
FileUtils.ln_s(locale_dir, in_source_dir('_posts'))
|
143
147
|
end
|
144
148
|
|
145
149
|
def redirect?
|
@@ -194,5 +198,21 @@ module Jekyll
|
|
194
198
|
FileUtils.ln_s File.join(rel, child), File.join(dst, child)
|
195
199
|
end
|
196
200
|
end
|
201
|
+
|
202
|
+
def posts_delete
|
203
|
+
FileUtils.rm_f in_source_dir('_posts')
|
204
|
+
end
|
205
|
+
|
206
|
+
def locale_dir
|
207
|
+
"_#{locale}"
|
208
|
+
end
|
209
|
+
|
210
|
+
def absolute_locale_dir
|
211
|
+
in_source_dir locale_dir
|
212
|
+
end
|
213
|
+
|
214
|
+
def locale_create
|
215
|
+
FileUtils.mkdir_p absolute_locale_dir
|
216
|
+
end
|
197
217
|
end
|
198
218
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-locales
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- f
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -117,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
117
117
|
- !ruby/object:Gem::Version
|
118
118
|
version: '0'
|
119
119
|
requirements: []
|
120
|
-
rubygems_version: 3.3.
|
120
|
+
rubygems_version: 3.3.26
|
121
121
|
signing_key:
|
122
122
|
specification_version: 4
|
123
123
|
summary: Jekyll plugin for localized sites
|