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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bc533228661daafdc98be0cba11e0cd64193956eabfc0a9c65e69196dfc6b61a
4
- data.tar.gz: 2f1c995dc7b6d0cae07105c1921bf8f518234365e72cb0000b7c5fef78855306
3
+ metadata.gz: 3844ff3bbcd03f8d023d24a5401dd33b5af8a6db56f27671b95f10452dc7ac5d
4
+ data.tar.gz: f34d64dd27499744a33e0c0003a62cf02e4b69fa14317cf9d81868908708c023
5
5
  SHA512:
6
- metadata.gz: 40b81bcc655683e1cfe3f6f2e126e0e3308d280164d9e47218c4e03802a28eeb4348d92b125ad14cb95f5fb95a21677f43899d182a7ac3549ea9555f5591f1f4
7
- data.tar.gz: ab2dddc5348b72195927d798262548e73543957f931f624fb924e08384dfead44e85c8d700cfb11aee8e8995ec346215a449482e19240ad33f03ad3aa25460af
6
+ metadata.gz: 9217d4a5f0976126ad03ea8f1d2aeae526d1daad4ab67dffe5ee666fd02d6a74f4061bdd15ebfc580614b1b4b81c57369005ad537547c0cef621711c4aaf9be2
7
+ data.tar.gz: 0e77fe3df350a568a085612fd71ac4bec31c19d7b7c15c9e92d77ecdd94808f78b49901b567a2082cd6f1b84c8b22f07f5b9852856277dd96f5d6e8dce8b9b59
@@ -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
- FileUtils.rm_f('_posts')
142
- FileUtils.ln_s("_#{locale}", '_posts')
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Jekyll
4
4
  module Locales
5
- VERSION = '0.2.0'
5
+ VERSION = '0.2.1'
6
6
  end
7
7
  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.0
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: 2022-10-06 00:00:00.000000000 Z
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.19
120
+ rubygems_version: 3.3.26
121
121
  signing_key:
122
122
  specification_version: 4
123
123
  summary: Jekyll plugin for localized sites