Skip to content

Commit f553d26

Browse files
committed
Merge branch 'master' of github.com:untra/polyglot
2 parents 1279325 + ba9f00d commit f553d26

File tree

301 files changed

+7913
-287
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

301 files changed

+7913
-287
lines changed

Gemfile.lock

Lines changed: 50 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,35 @@
11
PATH
22
remote: .
33
specs:
4-
jekyll-polyglot (1.7.0)
4+
jekyll-polyglot (1.8.0)
55
jekyll (>= 4.0, >= 3.0)
66

77
GEM
88
remote: https://rubygems.org/
99
specs:
10-
addressable (2.8.5)
10+
addressable (2.8.6)
1111
public_suffix (>= 2.0.2, < 6.0)
1212
ast (2.4.2)
1313
colorator (1.1.0)
14-
concurrent-ruby (1.2.2)
15-
diff-lcs (1.5.0)
14+
concurrent-ruby (1.2.3)
15+
diff-lcs (1.5.1)
1616
em-websocket (0.5.3)
1717
eventmachine (>= 0.12.9)
1818
http_parser.rb (~> 0)
1919
eventmachine (1.2.7)
2020
ffi (1.16.3)
2121
ffi (1.16.3-x64-mingw-ucrt)
2222
forwardable-extended (2.6.0)
23-
google-protobuf (3.24.4)
24-
google-protobuf (3.24.4-x64-mingw-ucrt)
25-
google-protobuf (3.24.4-x86_64-darwin)
23+
google-protobuf (4.26.0)
24+
rake (>= 13)
25+
google-protobuf (4.26.0-x64-mingw-ucrt)
26+
rake (>= 13)
27+
google-protobuf (4.26.0-x86_64-darwin)
28+
rake (>= 13)
2629
http_parser.rb (0.8.0)
27-
i18n (1.14.1)
30+
i18n (1.14.4)
2831
concurrent-ruby (~> 1.0)
29-
jekyll (4.3.2)
32+
jekyll (4.3.3)
3033
addressable (~> 2.4)
3134
colorator (~> 1.0)
3235
em-websocket (~> 0.5)
@@ -49,77 +52,79 @@ GEM
4952
sass-embedded (~> 1.54)
5053
jekyll-watch (2.2.1)
5154
listen (~> 3.0)
52-
json (2.6.3)
55+
json (2.7.1)
5356
kramdown (2.4.0)
5457
rexml
5558
kramdown-parser-gfm (1.1.0)
5659
kramdown (~> 2.0)
60+
language_server-protocol (3.17.0.3)
5761
liquid (4.0.4)
58-
listen (3.8.0)
62+
listen (3.9.0)
5963
rb-fsevent (~> 0.10, >= 0.10.3)
6064
rb-inotify (~> 0.9, >= 0.9.10)
6165
mercenary (0.4.0)
6266
mini_portile2 (2.8.5)
63-
minitest (5.16.3)
64-
nokogiri (1.15.4)
67+
minitest (5.22.3)
68+
nokogiri (1.16.3)
6569
mini_portile2 (~> 2.8.2)
6670
racc (~> 1.4)
67-
nokogiri (1.15.4-x64-mingw-ucrt)
71+
nokogiri (1.16.3-x64-mingw-ucrt)
6872
racc (~> 1.4)
69-
nokogiri (1.15.4-x86_64-darwin)
73+
nokogiri (1.16.3-x86_64-darwin)
7074
racc (~> 1.4)
71-
parallel (1.23.0)
72-
parser (3.2.2.4)
75+
parallel (1.24.0)
76+
parser (3.3.0.5)
7377
ast (~> 2.4.1)
7478
racc
7579
pathutil (0.16.2)
7680
forwardable-extended (~> 2.6)
77-
public_suffix (5.0.3)
78-
racc (1.7.1)
81+
public_suffix (5.0.4)
82+
racc (1.7.3)
7983
rainbow (3.1.1)
80-
rake (13.0.6)
84+
rake (13.1.0)
8185
rb-fsevent (0.11.2)
8286
rb-inotify (0.10.1)
8387
ffi (~> 1.0)
84-
regexp_parser (2.8.1)
88+
regexp_parser (2.9.0)
8589
rexml (3.2.6)
86-
rouge (4.1.3)
87-
rspec (3.11.0)
88-
rspec-core (~> 3.11.0)
89-
rspec-expectations (~> 3.11.0)
90-
rspec-mocks (~> 3.11.0)
91-
rspec-core (3.11.0)
92-
rspec-support (~> 3.11.0)
93-
rspec-expectations (3.11.1)
90+
rouge (4.2.0)
91+
rspec (3.13.0)
92+
rspec-core (~> 3.13.0)
93+
rspec-expectations (~> 3.13.0)
94+
rspec-mocks (~> 3.13.0)
95+
rspec-core (3.13.0)
96+
rspec-support (~> 3.13.0)
97+
rspec-expectations (3.13.0)
9498
diff-lcs (>= 1.2.0, < 2.0)
95-
rspec-support (~> 3.11.0)
96-
rspec-mocks (3.11.2)
99+
rspec-support (~> 3.13.0)
100+
rspec-mocks (3.13.0)
97101
diff-lcs (>= 1.2.0, < 2.0)
98-
rspec-support (~> 3.11.0)
99-
rspec-support (3.11.1)
102+
rspec-support (~> 3.13.0)
103+
rspec-support (3.13.1)
100104
rspec_junit_formatter (0.6.0)
101105
rspec-core (>= 2, < 4, != 2.12.0)
102-
rubocop (1.36.0)
106+
rubocop (1.62.1)
103107
json (~> 2.3)
108+
language_server-protocol (>= 3.17.0)
104109
parallel (~> 1.10)
105-
parser (>= 3.1.2.1)
110+
parser (>= 3.3.0.2)
106111
rainbow (>= 2.2.2, < 4.0)
107112
regexp_parser (>= 1.8, < 3.0)
108113
rexml (>= 3.2.5, < 4.0)
109-
rubocop-ast (>= 1.20.1, < 2.0)
114+
rubocop-ast (>= 1.31.1, < 2.0)
110115
ruby-progressbar (~> 1.7)
111-
unicode-display_width (>= 1.4.0, < 3.0)
112-
rubocop-ast (1.29.0)
113-
parser (>= 3.2.1.0)
116+
unicode-display_width (>= 2.4.0, < 3.0)
117+
rubocop-ast (1.31.2)
118+
parser (>= 3.3.0.4)
114119
ruby-progressbar (1.13.0)
115120
safe_yaml (1.0.5)
116-
sass-embedded (1.68.0)
117-
google-protobuf (~> 3.23)
121+
sass-embedded (1.72.0)
122+
google-protobuf (>= 3.25, < 5.0)
118123
rake (>= 13.0.0)
119-
sass-embedded (1.68.0-x64-mingw-ucrt)
120-
google-protobuf (~> 3.23)
121-
sass-embedded (1.68.0-x86_64-darwin)
122-
google-protobuf (~> 3.23)
124+
sass-embedded (1.72.0-x64-mingw-ucrt)
125+
google-protobuf (>= 3.25, < 5.0)
126+
sass-embedded (1.72.0-x86_64-darwin)
127+
google-protobuf (>= 3.25, < 5.0)
123128
terminal-table (3.0.2)
124129
unicode-display_width (>= 1.1.1, < 3)
125130
unicode-display_width (2.5.0)

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ In short:
6969

7070

7171
### Translation permalink information in page
72-
_New in 1.7.1_
72+
_New in 1.8.0_
7373

7474
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 redirections!
75+
This is useful in order to generate language menus and even localization meta information without redirects!
7676

7777
Sample code for meta link generation:
7878
```
@@ -233,6 +233,16 @@ This plugin makes modifications to existing Jekyll classes and modules, namely `
233233

234234
`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.
235235

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+
236246
### Machine-aware site building
237247
_New in 1.5.0_
238248

jekyll-polyglot.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Gem::Specification.new do |s|
22
s.name = 'jekyll-polyglot'
3-
s.version = '1.7.0'
4-
s.date = '2023-10-29'
3+
s.version = '1.8.0'
4+
s.date = '2024-03-17'
55
s.summary = 'I18n plugin for Jekyll Blogs'
66
s.description = 'Fast open source i18n plugin for Jekyll blogs.'
77
s.authors = ['Samuel Volin']

lib/jekyll/polyglot/patches/jekyll/site.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ def process
4343
while pids.length >= (lang == all_langs[-1] ? 1 : nproc)
4444
sleep 0.1
4545
pids.map do |lang, pid|
46-
pids.delete lang if waitpid pid, Process::WNOHANG
46+
next unless waitpid pid, Process::WNOHANG
47+
48+
pids.delete lang
49+
raise "Polyglot subprocess #{pid} (#{lang}) failed (#{$?.exitstatus})" unless $?.success?
4750
end
4851
end
4952
end
@@ -60,6 +63,7 @@ def process
6063
process_language lang
6164
end
6265
end
66+
Jekyll::Hooks.trigger :polyglot, :post_write
6367
end
6468

6569
alias site_payload_orig site_payload

make.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@echo off
2-
set VERSION="1.7.0"
2+
set VERSION="1.8.0"
33
REM this is running tests
44
CALL gem build jekyll-polyglot.gemspec
55
CALL gem install jekyll-polyglot-%VERSION%.gem

make.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#! /bin/sh
2-
VERSION="1.7.0"
2+
VERSION="1.8.0"
33
# this is running tests
44
gem build jekyll-polyglot.gemspec
55
gem install jekyll-polyglot-$VERSION.gem

site/_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ url: https://polyglot.untra.io
6262

6363
paginate: 5
6464
# Custom vars
65-
version: 1.7.0
65+
version: 1.8.0
6666
# practical values langsep are "|", "•", "·", "-", "–"
6767
langsep: ""
6868

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
layout: post
3+
title: Polyglot 1.8.0 - Community Contributions Release
4+
lang: en
5+
---
6+
7+
Get excited for Jekyll-Polyglot 1.8.0, which has a few feature improvements and recognizes community documentation and contributions!
8+
9+
## language specific permalinks
10+
11+
One new feature is to give pages language specific permalinks and to retain their association to other relative pages. This new feature is again improved by **[antoniovazquezblanco](https://github.com/antoniovazquezblanco)**, who is a gentleman and a scholar.
12+
13+
## sitemap generation & i18n SEO
14+
15+
This release also recognizes the quality [sitemap.xml]({{ site.url }}/sitemap.xml) and [robots.txt]({{ site.url }}/robots.txt) solution provided by **[jerturowetz](https://github.com/jerturowetz)**. This website now demonstrates and captures more SEO power by using these to be crawlable as a static jekyll website by search providers. See the example website files [here](https://github.com/untra/polyglot/tree/master/site).
16+
17+
## jekyll :polyglot :post_write hook
18+
19+
Github user **[obfusk](https://github.com/obfusk)** contributed a [tiny PR](https://github.com/untra/polyglot/pull/142) a few years back:
20+
21+
With polyglot `:site, :post_write` like these run for each child processes:
22+
23+
```rb
24+
Jekyll::Hooks.register :site, :post_write do |site|
25+
...
26+
end
27+
```
28+
29+
This release adds a custom `:post_write` hook that runs exactly once, after all languages been processed (whether or not `parallel_localization` is used):
30+
31+
```rb
32+
Jekyll::Hooks.register :polyglot, :post_write do |site|
33+
# do something amazing here!
34+
end
35+
```
36+
37+
This feature is helpful for complex jekyll static sites that make additional use of [jekyll hook plugins](https://jekyllrb.com/docs/plugins/hooks/).
38+
39+
She also contributed a fix for [additional logging when language subprocesses crash](https://github.com/untra/polyglot/pull/145). Thanks for this contribution!
40+
41+
## localized variables and portuguese translation.
42+
43+
**[george-gca](https://github.com/george-gca)** is a talented and awesome guy, contributing [an entire blogpost](/2024/02/29/localized-variables/) on how best to localize rich text from site data. He also provided a [site brazilian translation](https://polyglot.untra.io/pt-BR/).
44+
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
layout: post
3+
title: Polyglot 1.8.0 - Liberação de contribuições comunitárias
4+
lang: pt-BR
5+
---
6+
7+
Fique animado com o Jekyll-Polyglot 1.8.0, que tem algumas melhorias de recursos e reconhece a documentação e contribuições da comunidade!
8+
9+
## links permanentes específicos idoma
10+
11+
Um novo recurso é fornecer links permanentes específicos ao idioma das páginas e manter sua associação com outras páginas relativas. Este novo recurso foi novamente aprimorado por **[antoniovazquezblanco](https://github.com/antoniovazquezblanco)**, que é um cavalheiro e estudioso.
12+
13+
## geração de mapa de site e SEO i18n
14+
15+
Este lançamento também reconhece a qualidade [sitemap.xml]({{ site.url }}/sitemap.xml) y [robots.txt]({{ site.url }}/robots.txt) solução fornecida por **[jerturowetz](https://github.com/jerturowetz)**. Este site agora demonstra e captura mais poder de SEO ao usá-los para ser rastreável como um site jekyll estático por provedores de pesquisa. Veja os arquivos do site de exemplo [aqui](https://github.com/untra/polyglot/tree/master/site).
16+
17+
## jekyll :polyglot :post_write hook
18+
19+
Github user **[obfusk](https://github.com/obfusk)** contribuiu com [pequeno PRs](https://github.com/untra/polyglot/pull/142) alguns anos atrás:
20+
21+
Com o poliglota `:site, :post_write` como estes são executados para cada processo filho:
22+
23+
```rb
24+
Jekyll::Hooks.register :site, :post_write do |site|
25+
...
26+
end
27+
```
28+
29+
Esta versão adiciona um personalizado `:post_write` hook que é executado exatamente uma vez, depois que todos os idiomas foram processados (whether or not `parallel_localization` is used):
30+
31+
```rb
32+
Jekyll::Hooks.register :polyglot, :post_write do |site|
33+
# faça algo incrível aqui!
34+
end
35+
```
36+
37+
This feature is helpful for complex jekyll static sites that make additional use of [jekyll hook plugins](https://jekyllrb.com/docs/plugins/hooks/).
38+
39+
Obfusk also contributed a fix for [additional logging when language subprocesses crash](https://github.com/untra/polyglot/pull/145). Thanks for this contribution!
40+
41+
## localized variables and portuguese translation.
42+
43+
**[george-gca](https://github.com/george-gca)** is a talented and awesome guy, contributing [an entire blogpost](/2024/02/29/localized-variables/) on how best to localize rich text from site data. He also provided a [site brazilian translation](https://polyglot.untra.io/pt-BR/).
44+

site/_site/2012/02/06/whats-jekyll/index.html

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ <h1>
153153
<a class="sidebar-nav-item" href="https://rubygems.org/gems/jekyll-polyglot">Ruby Gem</a>
154154
<a class="sidebar-nav-item" href="https://github.com/untra/polyglot">GitHub project</a>
155155
<a class="sidebar-nav-item" href="https://github.com/untra/polyglot/tree/master/site/_posts/2012-02-06-whats-jekyll.md"><small>view this page source on github</small></a>
156-
<small class="sidebar-nav-item">Currently v1.7.0</small>
156+
<small class="sidebar-nav-item">Currently v1.8.0</small>
157157
</nav>
158158

159159
<p><small>&copy; 2024 Samuel Volin</small><br/><small>MIT Licensed</small></p>
@@ -197,6 +197,18 @@ <h2>Related Posts</h2>
197197

198198
<li>
199199
<h3>
200+
<<<<<<< HEAD
201+
=======
202+
<a href="/2024/03/17/polyglot-1.8.0/">
203+
Polyglot 1.8.0 - Community Contributions Release
204+
<small>17 Mar 2024</small>
205+
</a>
206+
</h3>
207+
</li>
208+
209+
<li>
210+
<h3>
211+
>>>>>>> ba9f00d2dcbb499906ea221681d9a11fc05f0302
200212
<a href="/2024/02/29/localized-variables/">
201213
Localized variables
202214
<small>29 Feb 2024</small>
@@ -213,6 +225,7 @@ <h3>
213225
</h3>
214226
</li>
215227

228+
<<<<<<< HEAD
216229
<li>
217230
<h3>
218231
<a href="/2023/06/08/polyglot-1.6.0-chinese-support/">
@@ -222,6 +235,8 @@ <h3>
222235
</h3>
223236
</li>
224237

238+
=======
239+
>>>>>>> ba9f00d2dcbb499906ea221681d9a11fc05f0302
225240
</ul>
226241
</div>
227242

0 commit comments

Comments
 (0)