jekyll-polyglot 1.5.1 → 1.6.0

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: 575ea909b15958d5cddafc881fb4342326f205bf9fafbce8a79981133c4a15e5
4
- data.tar.gz: 1e881bdd502d11c0b3c171b7a4db7670d314f32ea0fe192a9a3fffbd47b1e1c2
3
+ metadata.gz: 52fcf4f09a9d96c2255ca7226c0a26d5dc7cf5e337fc03805e3e3d18ff00d7d9
4
+ data.tar.gz: 6a136ac3a5459c28c39ec71876e01ebee0582154f448ead285169bede86acb9f
5
5
  SHA512:
6
- metadata.gz: 15cd5d7b397550143957d9ebf7404c35c241bf4357f75f6fa7f44bde56034d631a3ea6ee0e7e3d80a53a9f8abcb99a5ee5b8685d125b63e08369db9cae28c1d7
7
- data.tar.gz: f837a8c341809322d210a90098d9016d6303865a665a832abf38443912f61c969a1e5c08dc4b2206f0ef47712ce24e208202b6c46e2d34ceaa1066c6ff19aeef
6
+ metadata.gz: 9fe64a2a499c51edd8e3a861d8b2805f4283dc89301be66c942d297f44923a3a1203b58ffd5183615fa34a4d01b1a30df01c76bb29626f57258e8b5e7396cbb3
7
+ data.tar.gz: f22f0727628cfed097dc18845fbd44de02629909d1a4db22767b1b9d52538a1a1287103bab7e8cc85e4e611f74365a7e789515b9b807d7c85751e8a660ef6a1e
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2015 - 2022 Samuel Volin
1
+ Copyright (c) 2015 - 2023 Samuel Volin
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
4
 
data/README.md CHANGED
@@ -50,6 +50,8 @@ or whatever appropriate [I18n language code](https://developer.chrome.com/websto
50
50
  the page should build for. And you're done. Ideally, when designing your site, you should
51
51
  organize files by their relative urls.
52
52
 
53
+ You can see how the live polyglot website [configures and supports multiple languages](https://github.com/untra/polyglot/blob/master/site/_config.yml#L28-L37), and examples of [community](https://github.com/untra/polyglot/pull/155) [language](https://github.com/untra/polyglot/pull/167) [contributions](https://github.com/untra/polyglot/pull/177).
54
+
53
55
  Polyglot works by associating documents with similar permalinks to the `lang` specified in their frontmatter. Files that correspond to similar routes should have identical permalinks. If you don't provide a permalink for a post, ___make sure you are consistent___ with how you place and name corresponding files:
54
56
  ```
55
57
  _posts/2010-03-01-salad-recipes-en.md
@@ -142,7 +144,7 @@ lang-exclusive: ['en', 'fr']
142
144
  #### Machine-aware site building
143
145
  _New in 1.5.0_
144
146
 
145
- Polyglot will only start builds after it confirms there is a cpu core ready to accept the build thread. This ensures that jekyll will build large sites efficiently streamlining build processes instead of overloading machines with process thrash.
147
+ Polyglot will only start builds after it confirms there is a cpu core ready to accept the build thread. This ensures that jekyll will build large sites efficiently, streamlining build processes instead of overloading machines with process thrash.
146
148
 
147
149
  #### Localized site.data
148
150
 
@@ -155,6 +157,13 @@ This plugin makes modifications to existing Jekyll classes and modules, namely `
155
157
 
156
158
  `Jekyll::Site.process` is the entry point for the Jekyll build process. Take care whatever other plugins you use do not also attempt to overwrite this method. You may have problems.
157
159
 
160
+
161
+ ### Writing Tests and Debugging
162
+ _:wave: I need assistance with modern ruby best practices for test maintenance with rake and rspec. If you got the advice I have the ears._
163
+
164
+ Tests are run with `bundle exec rake`. Tests are in the `/spec` directory, and test failure output detail can be examined in the `rspec.xml` file.
165
+
166
+
158
167
  ## Features
159
168
  This plugin stands out from other I18n Jekyll plugins.
160
169
  - automatically corrects your relative links, keeping your *french* visitors on your *french* website, even when content has to fallback to the `default_lang`.
@@ -180,10 +189,11 @@ Feel free to open a PR and list your multilingual blog here you may want to shar
180
189
  * [F-Droid](https://f-droid.org)
181
190
  * [Ubuntu MATE](https://ubuntu-mate.org)
182
191
  * [Leo3418 blog](https://leo3418.github.io/)
192
+ * [Gaphor](https://gaphor.org)
193
+ * [Yi Yunseok's personal blog website](https://Yi-Yunseok.GitHub.io)
183
194
 
184
195
  ## Compatibility
185
196
  Currently supports Jekyll 3.0 , and Jekyll 4.0
186
-
187
197
  * Windows users will need to disable parallel_localization on their machines by setting `parallel_localization: false` in the `_config.yml`
188
198
  * In Jekyll 4.0 , SCSS source maps will generate improperly due to how Polyglot operates. The workaround is to disable the CSS sourcemaps. Adding the following to your `config.yml` will disable sourcemap generation:
189
199
  ```yaml
@@ -194,20 +204,23 @@ sass:
194
204
  ## Contributions
195
205
  Please! I need all the support I can get! 🙏
196
206
 
197
- But for real I would appreciate any contributions and support. This started as an open-source side-project and has gotten bigger than I'd ever imagine!
207
+ But for real I would appreciate any code contributions and support. This started as an open-source side-project and has gotten bigger than I'd ever imagine!
198
208
  If you have something you'd like to contribute to jekyll-polyglot, please open a PR!
199
209
 
200
210
 
201
211
  ## 2.0 Roadmap
202
- * [ ] - **site language**: portuguese `pt_BR` `pt_PT`
212
+ * [ ] - **site language**: portuguese Brazil `pt-BR` `pt-PT`
213
+ * [ ] - **site language**: portuguese Portugal `pt-BR` `pt-PT`
203
214
  * [ ] - **site language**: arabic `ar`
204
215
  * [ ] - **site language**: japanese `ja`
205
216
  * [x] - **site language**: russian `ru`
206
217
  * [x] - **site language**: dutch `nl`
207
- * [ ] - **site language**: korean `ko`
218
+ * [x] - **site language**: korean `ko`
208
219
  * [x] - **site language**: hebrew `he`
220
+ * [x] - **site language**: chinese China `zh-CN`
221
+ * [ ] - **site language**: chinese Taiwan `zh_TW`
209
222
  * [ ] - get whitelisted as an official github-pages jekyll plugin
210
223
  * [x] - update CI provider
211
224
 
212
225
  ## Copyright
213
- Copyright (c) Samuel Volin 2022. License: MIT
226
+ Copyright (c) Samuel Volin 2023. License: MIT
@@ -213,26 +213,30 @@ module Jekyll
213
213
 
214
214
  def relativize_urls(doc, regex)
215
215
  return if doc.output.nil?
216
-
217
- doc.output.gsub!(regex, "href=\"#{@baseurl}/#{@active_lang}/" + '\1"')
216
+ modified_output = doc.output.dup
217
+ modified_output.gsub!(regex, "href=\"#{@baseurl}/#{@active_lang}/" + '\1"')
218
+ doc.output = modified_output
218
219
  end
219
220
 
220
221
  def relativize_absolute_urls(doc, regex, url)
221
222
  return if doc.output.nil?
222
-
223
- doc.output.gsub!(regex, "href=\"#{url}#{@baseurl}/#{@active_lang}/" + '\1"')
223
+ modified_output = doc.output.dup
224
+ modified_output.gsub!(regex, "href=\"#{url}#{@baseurl}/#{@active_lang}/" + '\1"')
225
+ doc.output = modified_output
224
226
  end
225
227
 
226
228
  def correct_nonrelativized_absolute_urls(doc, regex, url)
227
229
  return if doc.output.nil?
228
-
229
- doc.output.gsub!(regex, "href=\"#{url}#{@baseurl}/" + '\1"')
230
+ modified_output = doc.output.dup
231
+ modified_output.gsub!(regex, "href=\"#{url}#{@baseurl}/" + '\1"')
232
+ doc.output = modified_output
230
233
  end
231
234
 
232
235
  def correct_nonrelativized_urls(doc, regex)
233
236
  return if doc.output.nil?
234
-
235
- doc.output.gsub!(regex, "href=\"#{@baseurl}/" + '\1"')
237
+ modified_output = doc.output.dup
238
+ modified_output.gsub!(regex, "href=\"#{@baseurl}/" + '\1"')
239
+ doc.output = modified_output
236
240
  end
237
241
  end
238
242
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-polyglot
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Volin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-01 00:00:00.000000000 Z
11
+ date: 2023-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -17,6 +17,9 @@ dependencies:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '3.0'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: '4.0'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -24,6 +27,9 @@ dependencies:
24
27
  - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: '3.0'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '4.0'
27
33
  description: Fast open source i18n plugin for Jekyll blogs.
28
34
  email: untra.sam@gmail.com
29
35
  executables: []