jekyll-polyglot 1.7.0 → 1.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +115 -36
- data/lib/jekyll/polyglot/liquid/tags/i18n_headers.rb +4 -2
- data/lib/jekyll/polyglot/patches/jekyll/site.rb +22 -3
- 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: 8d73df8783960d5b0262535d61bf824f185df2eb4d0c81e80ac37d2bb883cd4d
|
4
|
+
data.tar.gz: 25478bc7da36ccf7771fd4eb32028d6ca54dee9d16254b88e883b1a8a797e861
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2878206ca521985036740435fbf098c3d1b8570f4d54e8e16981356e5e1400e23c68b261b1bf0310bf700f20e738fccbc589773a8cb0d81129477529076f3f57
|
7
|
+
data.tar.gz: 72bafd7617f5642c80d22522789d62670e453982dcb1b35df8cc9f9f514e5134ccad143cdb57ce8a6275648c0fa8271d157aa62159103ac071602d5a85df17bf
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/jekyll-polyglot.svg)](https://badge.fury.io/rb/jekyll-polyglot)
|
4
4
|
[![CircleCI](https://circleci.com/gh/untra/polyglot/tree/master.svg?style=svg)](https://circleci.com/gh/untra/polyglot/?branch=master)
|
5
5
|
|
6
|
-
__Polyglot__ is a fast, painless, open-source internationalization plugin for [Jekyll](http://jekyllrb.com) blogs. Polyglot is easy to
|
6
|
+
__Polyglot__ is a fast, painless, open-source internationalization plugin for [Jekyll](http://jekyllrb.com) blogs. Polyglot is easy to set up and use with any Jekyll project, and it scales to the languages you want to support. With fallback support for missing content, automatic url relativization, and powerful SEO tools, Polyglot allows any multi-language jekyll blog to focus on content without the cruft.
|
7
7
|
|
8
8
|
## Why?
|
9
9
|
Jekyll doesn't provide native support for multi-language blogs. This plugin was modeled after the [jekyll-multiple-languages-plugin](https://github.com/screeninteraction/jekyll-multiple-languages-plugin), whose implementation I liked, but execution I didn't.
|
@@ -34,7 +34,7 @@ These configuration preferences indicate
|
|
34
34
|
- what i18n languages you wish to support
|
35
35
|
- what is your default "fallback" language for your content
|
36
36
|
- what root level files/folders are excluded from localization, based
|
37
|
-
on if their paths start with any of the excluded regexp substrings. (this is different
|
37
|
+
on if their paths start with any of the excluded regexp substrings. (this is different from the jekyll `exclude: [ .gitignore ]` ; you should `exclude` files and directories in your repo you dont want in your built site at all, and `exclude_from_localization` files and directories you want to see in your built site, but not in your sublanguage sites.)
|
38
38
|
- whether to run language processing in parallel or serial
|
39
39
|
|
40
40
|
The optional `lang_from_path: true` option enables getting page
|
@@ -50,7 +50,7 @@ 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
|
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
54
|
|
55
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:
|
56
56
|
```
|
@@ -59,7 +59,7 @@ _posts/2010-03-01-salad-recipes-sv.md
|
|
59
59
|
_posts/2010-03-01-salad-recipes-fr.md
|
60
60
|
```
|
61
61
|
|
62
|
-
Organized names will generate consistent permalinks when the post is rendered, and
|
62
|
+
Organized names will generate consistent permalinks when the post is rendered, and Polyglot will know to build separate language versions of
|
63
63
|
the website using only the files with the correct `lang` variable in the front matter.
|
64
64
|
|
65
65
|
In short:
|
@@ -68,12 +68,27 @@ In short:
|
|
68
68
|
* Don't overthink it, :wink:
|
69
69
|
|
70
70
|
|
71
|
+
### Translation permalink information in page
|
72
|
+
_New in 1.8.0_
|
73
|
+
|
74
|
+
Whenever `page_id` frontmatter properties are used to identify translations, permalink information for the available languages is available in `permalink_lang`.
|
75
|
+
This is useful in order to generate language menus and even localization meta information without redirects!
|
76
|
+
|
77
|
+
Sample code for meta link generation:
|
78
|
+
```
|
79
|
+
{% for lang in site.languages %}
|
80
|
+
{% capture lang_href %}{{site.baseurl}}/{% if lang != site.default_lang %}{{ lang }}/{% endif %}{% if page.permalink_lang[lang] != '/' %}{{page.permalink_lang[lang]}}{% endif %}{% endcapture %}
|
81
|
+
<link rel="alternate" hreflang="{{ lang }}" {% static_href %}href="{{ lang_href }}"{% endstatic_href %} />
|
82
|
+
{% endfor %}
|
83
|
+
```
|
84
|
+
|
85
|
+
|
71
86
|
#### Using different permalinks per language
|
72
87
|
_New in 1.7.0_
|
73
88
|
|
74
89
|
Optionally, for those who may want different URLs on different languages, translations may be identified by specifying a `page_id` in the frontmatter.
|
75
90
|
|
76
|
-
If available,
|
91
|
+
If available, Polyglot will use `page_id` to identify the page, and will default to the `permalink` otherwise.
|
77
92
|
|
78
93
|
As an example, you may have an about page located in `/about/` while being in `/acerca-de/` in Spanish just by changing the permalink and specifying a `page_id` that will link the files as translations:
|
79
94
|
```md
|
@@ -105,8 +120,8 @@ Lets say you are building your website. You have an `/about/` page written in *e
|
|
105
120
|
|
106
121
|
No worries. Polyglot ensures the sitemap of your *english* site matches your *french* site, matches your *swedish* and *german* sites too. In this case, because you specified a `default_lang` variable in your `_config.yml`, all sites missing their languages' counterparts will fallback to your `default_lang`, so content is preserved across different languages of your site.
|
107
122
|
|
108
|
-
|
109
|
-
No need to meticulously manage anchor tags to link to your correct language. Polyglot modifies how pages get written to the site so your *french* links keep
|
123
|
+
### Relativized Local Urls
|
124
|
+
No need to meticulously manage anchor tags to link to your correct language. Polyglot modifies how pages get written to the site so your *french* links keep visitors on your *french* blog.
|
110
125
|
```md
|
111
126
|
---
|
112
127
|
title: au sujet de notre entreprise
|
@@ -129,8 +144,8 @@ Notice the link `<a href="/fr/menu/">...` directs to the french website.
|
|
129
144
|
|
130
145
|
Even if you are falling back to `default_lang` page, relative links built on the *french* site will still link to *french* pages.
|
131
146
|
|
132
|
-
|
133
|
-
If you defined a site `url` in your `_config.yaml`,
|
147
|
+
### Relativized Absolute Urls
|
148
|
+
If you defined a site `url` in your `_config.yaml`, Polyglot will automatically relativize absolute links pointing to your website directory:
|
134
149
|
|
135
150
|
```md
|
136
151
|
---
|
@@ -143,7 +158,7 @@ becomes
|
|
143
158
|
<p>Cliquez <a href="https://mywebsite.com/fr/">ici</a> pour aller à l'entrée du site.
|
144
159
|
```
|
145
160
|
|
146
|
-
|
161
|
+
### Disabling Url Relativizing
|
147
162
|
_New in 1.4.0_
|
148
163
|
If you dont want a href attribute to be relativized (such as for making [a language switcher](https://github.com/untra/polyglot/blob/master/site/_includes/sidebar.html#L40)), you can use the block tag:
|
149
164
|
|
@@ -159,11 +174,10 @@ that will generate `<a href="/about">click this static link</a>` which is what y
|
|
159
174
|
|
160
175
|
Combine with a [html minifier](https://github.com/digitalsparky/jekyll-minifier) for a polished and production ready website.
|
161
176
|
|
162
|
-
|
177
|
+
### Exclusive site language generation
|
163
178
|
_New in 1.4.0_
|
164
179
|
|
165
|
-
If you want to control which languages a document can be generated for, you can specify `lang-exclusive: [ ]` frontmatter.
|
166
|
-
If you include this frontmatter in your post, it will only generate for the specified site languages.
|
180
|
+
If you want to control which languages a document can be generated for, you can specify `lang-exclusive: [ ]` frontmatter. If you include this frontmatter in your post, it will only generate for the specified site languages.
|
167
181
|
|
168
182
|
For Example, the following frontmatter will only generate in the `en` and `fr` site language builds:
|
169
183
|
```
|
@@ -172,29 +186,73 @@ lang-exclusive: ['en', 'fr']
|
|
172
186
|
---
|
173
187
|
```
|
174
188
|
|
175
|
-
|
176
|
-
|
189
|
+
### Localized site.data
|
190
|
+
There are cases where you may want to have a list of `key: value` pairs of translated content. For example, instead of creating a complete separate file for each language containing the layout structure and localized content, you can create a single file with the layout that will be shared among pages, and then create a language-specific file with the localized content that will be used.
|
177
191
|
|
178
|
-
|
192
|
+
To do this, you can create a file like `_data/:lang/strings.yml`, one for each language, and Polyglot will bring those keys under `site.data[:lang].strings`. For example, suppose you have the following files:
|
193
|
+
|
194
|
+
`_data/en/strings.yml`
|
195
|
+
```yaml
|
196
|
+
hello: "Hello"
|
197
|
+
greetings:
|
198
|
+
morning: "Good morning"
|
199
|
+
evening: "Good evening"
|
200
|
+
```
|
201
|
+
|
202
|
+
`_data/pt-br/strings.yml`
|
203
|
+
```yaml
|
204
|
+
hello: "Olá"
|
205
|
+
greetings:
|
206
|
+
morning: "Bom dia"
|
207
|
+
evening: "Boa noite"
|
208
|
+
```
|
209
|
+
|
210
|
+
You can use the `site.data` to access the localized content in your layouts and pages:
|
211
|
+
|
212
|
+
```liquid
|
213
|
+
<p>{{ site.data[site.active_lang].strings.hello }}, {{ site.data[site.active_lang].strings.greetings.morning }}</p>
|
214
|
+
```
|
179
215
|
|
180
|
-
|
216
|
+
For more information on this matter, check out this [post](https://polyglot.untra.io/2024/02/29/localized-variables/).
|
181
217
|
|
182
|
-
|
183
|
-
|
184
|
-
|
218
|
+
### Localized collections
|
219
|
+
|
220
|
+
To localize collections, you first have to properly define the collection in your `_config.yml` file. For example, if you have a collection of `projects`, you can define it like this:
|
221
|
+
|
222
|
+
```yaml
|
223
|
+
collections:
|
224
|
+
projects:
|
225
|
+
output: true
|
226
|
+
permalink: /:collection/:title/
|
227
|
+
```
|
228
|
+
|
229
|
+
Note that the [permalink](https://jekyllrb.com/docs/permalinks/#collections) definition here is important. Then, you can create a file for each language in the `_projects` directory, and Polyglot will bring those files under `site.projects`. For more information, check the related discussion #188.
|
185
230
|
|
186
231
|
## How It Works
|
187
232
|
This plugin makes modifications to existing Jekyll classes and modules, namely `Jekyll::StaticFile` and `Jekyll::Site`. These changes are as lightweight and slim as possible. The biggest change is in `Jekyll::Site.process`. Polyglot overwrites this method to instead spawn a separate process for each language you intend to process the site for. Each of those processes calls the original `Jekyll::Site.process` method with its language in mind, ensuring your website scales to support any number of languages, while building all of your site languages simultaneously.
|
188
233
|
|
189
234
|
`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.
|
190
235
|
|
236
|
+
### (:polyglot, :post_write) hook
|
237
|
+
_New in 1.8.0_
|
238
|
+
Polyglot issues a `:polyglot, :post_write` hook event once all languages have been built for the site. This hook runs exactly once, after all site languages been processed:
|
239
|
+
|
240
|
+
```rb
|
241
|
+
Jekyll::Hooks.register :polyglot, :post_write do |site|
|
242
|
+
# do something custom and cool here!
|
243
|
+
end
|
244
|
+
```
|
245
|
+
|
246
|
+
### Machine-aware site building
|
247
|
+
_New in 1.5.0_
|
248
|
+
|
249
|
+
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.
|
191
250
|
|
192
251
|
### Writing Tests and Debugging
|
193
252
|
_: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._
|
194
253
|
|
195
254
|
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.
|
196
255
|
|
197
|
-
|
198
256
|
## Features
|
199
257
|
This plugin stands out from other I18n Jekyll plugins.
|
200
258
|
- automatically corrects your relative links, keeping your *french* visitors on your *french* website, even when content has to fallback to the `default_lang`.
|
@@ -208,20 +266,11 @@ This plugin stands out from other I18n Jekyll plugins.
|
|
208
266
|
- a creator that will answer all of your questions and issues.
|
209
267
|
|
210
268
|
## SEO Recipes
|
211
|
-
Jekyll-polyglot has a few spectacular [Search Engine Optimization techniques](https://untra.github.io/polyglot/seo) to ensure your Jekyll blog gets the most out of
|
269
|
+
Jekyll-polyglot has a few spectacular [Search Engine Optimization techniques](https://untra.github.io/polyglot/seo) to ensure your Jekyll blog gets the most out of its multilingual audience. Check them out!
|
212
270
|
|
213
|
-
###
|
214
|
-
Feel free to open a PR and list your multilingual blog here you may want to share:
|
271
|
+
### Sitemap generation
|
215
272
|
|
216
|
-
|
217
|
-
* [LogRhythm Corporate Website](https://logrhythm.com)
|
218
|
-
* [All Over Earth](https://allover.earth/)
|
219
|
-
* [Hanare Cafe in Toshijima, Japan](https://hanarecafe.com)
|
220
|
-
* [F-Droid](https://f-droid.org)
|
221
|
-
* [Ubuntu MATE](https://ubuntu-mate.org)
|
222
|
-
* [Leo3418 blog](https://leo3418.github.io/)
|
223
|
-
* [Gaphor](https://gaphor.org)
|
224
|
-
* [Yi Yunseok's personal blog website](https://Yi-Yunseok.GitHub.io)
|
273
|
+
See the example [sitemap.xml](/site/sitemap.xml) and [robots.txt](/site/robots.txt) for how to automatically generate a multi-language sitemap for your page and turn it in for the SEO i18n credit.
|
225
274
|
|
226
275
|
## Compatibility
|
227
276
|
Currently supports Jekyll 3.0 , and Jekyll 4.0
|
@@ -238,10 +287,40 @@ Please! I need all the support I can get! 🙏
|
|
238
287
|
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!
|
239
288
|
If you have something you'd like to contribute to jekyll-polyglot, please open a PR!
|
240
289
|
|
290
|
+
### Contributors
|
291
|
+
These are talented and considerate software developers across the world that have lent their support to this project.
|
292
|
+
**Thank You! ¡Gracias! Merci! Danke! 감사합니다! תודה רבה! Спасибо! Dankjewel! 谢谢!Obrigado!**
|
293
|
+
|
294
|
+
* [@blackpill](https://github.com/blackpill) [1.8.1](https://polyglot.untra.io/2024/08/18/polyglot-1.8.1/)
|
295
|
+
* [@hacketiwack](https://github.com/hacketiwack) [1.8.1](https://polyglot.untra.io/2024/08/18/polyglot-1.8.1/)
|
296
|
+
* [@jerturowetz](https://github.com/jerturowetz) [sitemap generation](https://polyglot.untra.io/2024/03/17/polyglot-1.8.0/)
|
297
|
+
* [@antoniovazquezblanco](https://github.com/antoniovazquezblanco) [1.7.0](https://polyglot.untra.io/2023/10/29/polyglot-1.7.0/)
|
298
|
+
* [@salinatedcoffee](https://github.com/SalinatedCoffee) [ko support](https://polyglot.untra.io/2023/02/27/korean-support/)
|
299
|
+
* [@aturret](https://github.com/aturret) [zh-CN support](https://polyglot.untra.io/2023/06/08/polyglot-1.6.0-chinese-support/)
|
300
|
+
* [@dougieh](https://github.com/dougieh) [1.5.1](https://polyglot.untra.io/2022/10/01/polyglot-1.5.1/)
|
301
|
+
* [@pandermusubi](https://github.com/PanderMusubi) [nl support](https://polyglot.untra.io/2022/01/15/dutch-site-support/)
|
302
|
+
* [@obfusk](https://github.com/obfusk) [1.5.0](https://polyglot.untra.io/2021/07/17/polyglot-1.5.0/)
|
303
|
+
* [@eighthave](https://github.com/eighthave) [1.5.0](https://polyglot.untra.io/2021/07/17/polyglot-1.5.0/)
|
304
|
+
* [@george-gca](https://github.com/george-gca) [Localized Variables](https://polyglot.untra.io/2024/02/29/localized-variables.md)
|
305
|
+
|
306
|
+
### Other Websites Built with Polyglot
|
307
|
+
Feel free to open a PR and list your multilingual blog here you may want to share:
|
308
|
+
|
309
|
+
* [**Polyglot project website**](https://polyglot.untra.io)
|
310
|
+
* [LogRhythm Corporate Website](https://logrhythm.com)
|
311
|
+
* [All Over Earth](https://allover.earth/)
|
312
|
+
* [Hanare Cafe in Toshijima, Japan](https://hanarecafe.com)
|
313
|
+
* [F-Droid](https://f-droid.org)
|
314
|
+
* [Ubuntu MATE](https://ubuntu-mate.org)
|
315
|
+
* [Leo3418 blog](https://leo3418.github.io/)
|
316
|
+
* [Gaphor](https://gaphor.org)
|
317
|
+
* [Yi Yunseok's personal blog website](https://Yi-Yunseok.GitHub.io)
|
318
|
+
* [Tarlogic Cybersecurity](https://www.tarlogic.com/)
|
319
|
+
* [A beautiful, simple, clean, and responsive Jekyll theme for academics](https://github.com/george-gca/multi-language-al-folio)
|
241
320
|
|
242
321
|
## 2.0 Roadmap
|
243
|
-
* [
|
244
|
-
* [ ] - **site language**: portuguese Portugal `pt-
|
322
|
+
* [x] - **site language**: portuguese Brazil `pt-BR`
|
323
|
+
* [ ] - **site language**: portuguese Portugal `pt-PT`
|
245
324
|
* [ ] - **site language**: arabic `ar`
|
246
325
|
* [ ] - **site language**: japanese `ja`
|
247
326
|
* [x] - **site language**: russian `ru`
|
@@ -249,7 +328,7 @@ If you have something you'd like to contribute to jekyll-polyglot, please open a
|
|
249
328
|
* [x] - **site language**: korean `ko`
|
250
329
|
* [x] - **site language**: hebrew `he`
|
251
330
|
* [x] - **site language**: chinese China `zh-CN`
|
252
|
-
* [ ] - **site language**: chinese Taiwan `
|
331
|
+
* [ ] - **site language**: chinese Taiwan `zh-TW`
|
253
332
|
* [ ] - get whitelisted as an official github-pages jekyll plugin
|
254
333
|
* [x] - update CI provider
|
255
334
|
|
@@ -12,15 +12,17 @@ module Jekyll
|
|
12
12
|
def render(context)
|
13
13
|
site = context.registers[:site]
|
14
14
|
permalink = context.registers[:page]['permalink']
|
15
|
+
permalink_lang = context.registers[:page]['permalink_lang']
|
15
16
|
site_url = @url.empty? ? site.config['url'] : @url
|
16
17
|
i18n = "<meta http-equiv=\"Content-Language\" content=\"#{site.active_lang}\">\n"
|
17
18
|
i18n += "<link rel=\"alternate\" hreflang=\"#{site.default_lang}\" "\
|
18
|
-
"href=\"#{site_url}
|
19
|
+
"href=\"#{site_url}/#{permalink}\"/>\n"
|
19
20
|
site.languages.each do |lang|
|
20
21
|
next if lang == site.default_lang
|
21
22
|
|
23
|
+
url = permalink_lang && permalink_lang[lang] ? permalink_lang[lang] : permalink
|
22
24
|
i18n += "<link rel=\"alternate\" hreflang=\"#{lang}\" "\
|
23
|
-
"href=\"#{site_url}/#{lang}
|
25
|
+
"href=\"#{site_url}/#{lang}/#{url}\"/>\n"
|
24
26
|
end
|
25
27
|
i18n
|
26
28
|
end
|
@@ -43,7 +43,10 @@ module Jekyll
|
|
43
43
|
while pids.length >= (lang == all_langs[-1] ? 1 : nproc)
|
44
44
|
sleep 0.1
|
45
45
|
pids.map do |lang, pid|
|
46
|
-
|
46
|
+
next unless waitpid pid, Process::WNOHANG
|
47
|
+
|
48
|
+
pids.delete lang
|
49
|
+
raise "Polyglot subprocess #{pid} (#{lang}) failed (#{$?.exitstatus})" unless $?.success?
|
47
50
|
end
|
48
51
|
end
|
49
52
|
end
|
@@ -60,6 +63,7 @@ module Jekyll
|
|
60
63
|
process_language lang
|
61
64
|
end
|
62
65
|
end
|
66
|
+
Jekyll::Hooks.trigger :polyglot, :post_write
|
63
67
|
end
|
64
68
|
|
65
69
|
alias site_payload_orig site_payload
|
@@ -134,7 +138,7 @@ module Jekyll
|
|
134
138
|
lang_exclusive = doc.data['lang-exclusive'] || []
|
135
139
|
url = doc.url.gsub(regex, '/')
|
136
140
|
page_id = doc.data['page_id'] || url
|
137
|
-
doc.data['permalink'] = url
|
141
|
+
doc.data['permalink'] = url if doc.data['permalink'].to_s.empty? && !doc.data['lang'].to_s.empty?
|
138
142
|
|
139
143
|
# skip entirely if nothing to check
|
140
144
|
next if @file_langs.nil?
|
@@ -149,6 +153,7 @@ module Jekyll
|
|
149
153
|
@file_langs[page_id] = lang
|
150
154
|
end
|
151
155
|
approved.values.each {|doc| assignPageRedirects(doc, docs) }
|
156
|
+
approved.values.each {|doc| assignPageLanguagePermalinks(doc, docs) }
|
152
157
|
approved.values
|
153
158
|
end
|
154
159
|
|
@@ -166,7 +171,21 @@ module Jekyll
|
|
166
171
|
end
|
167
172
|
end
|
168
173
|
|
169
|
-
|
174
|
+
def assignPageLanguagePermalinks(doc, docs)
|
175
|
+
pageId = doc.data['page_id']
|
176
|
+
if !pageId.nil? && !pageId.empty?
|
177
|
+
unless doc.data['permalink_lang'] then doc.data['permalink_lang'] = {} end
|
178
|
+
permalinkDocs = docs.select do |dd|
|
179
|
+
dd.data['page_id'] == pageId
|
180
|
+
end
|
181
|
+
permalinkDocs.each do |dd|
|
182
|
+
doclang = dd.data['lang'] || derive_lang_from_path(dd) || @default_lang
|
183
|
+
doc.data['permalink_lang'][doclang] = dd.data['permalink']
|
184
|
+
end
|
185
|
+
end
|
186
|
+
end
|
187
|
+
|
188
|
+
# performs any necessary operations on the documents before rendering them
|
170
189
|
def process_documents(docs)
|
171
190
|
# return if @active_lang == @default_lang
|
172
191
|
|
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.
|
4
|
+
version: 1.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Volin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -63,7 +63,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
63
63
|
requirements:
|
64
64
|
- - ">="
|
65
65
|
- !ruby/object:Gem::Version
|
66
|
-
version: 2.
|
66
|
+
version: 2.7.0
|
67
67
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
68
68
|
requirements:
|
69
69
|
- - ">="
|