Skip to content

Commit

Permalink
Merge pull request #183 from untra/prep-for-1.7.0
Browse files Browse the repository at this point in the history
Prep for 1.7.0 release
  • Loading branch information
untra authored Oct 29, 2023
2 parents 55800af + 9884207 commit 30fba11
Show file tree
Hide file tree
Showing 342 changed files with 16,377 additions and 6,340 deletions.
6 changes: 6 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ Style/RaiseArgs:
Style/SignalException:
Enabled: false

Metrics/PerceivedComplexity:
Max: 15

Metrics/CyclomaticComplexity:
Max: 15

Metrics/AbcSize:
Max: 20

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ If you make any contributions to ruby source code, I will request you add a test

In the spec/ directory there are a series of ruby spec files.

run tests with `bundle exec rspec`
run tests with `bundle exec rspec --format RspecJunitFormatter`

1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ end

gem 'jekyll'
gem 'jekyll-paginate'
gem 'jekyll-redirect-from'
gem "webrick", "~> 1.7"
82 changes: 46 additions & 36 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
PATH
remote: .
specs:
jekyll-polyglot (1.6.0)
jekyll-polyglot (1.7.0)
jekyll (>= 4.0, >= 3.0)

GEM
remote: https://rubygems.org/
specs:
addressable (2.8.1)
addressable (2.8.5)
public_suffix (>= 2.0.2, < 6.0)
ast (2.4.2)
colorator (1.1.0)
Expand All @@ -17,63 +17,69 @@ GEM
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
eventmachine (1.2.7)
ffi (1.15.5)
ffi (1.16.3)
forwardable-extended (2.6.0)
google-protobuf (3.24.4)
google-protobuf (3.24.4-x86_64-darwin)
http_parser.rb (0.8.0)
i18n (0.9.5)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
jekyll (4.0.1)
jekyll (4.3.2)
addressable (~> 2.4)
colorator (~> 1.0)
em-websocket (~> 0.5)
i18n (>= 0.9.5, < 2)
jekyll-sass-converter (~> 2.0)
i18n (~> 1.0)
jekyll-sass-converter (>= 2.0, < 4.0)
jekyll-watch (~> 2.0)
kramdown (~> 2.1)
kramdown (~> 2.3, >= 2.3.1)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (~> 0.3.3)
mercenary (>= 0.3.6, < 0.5)
pathutil (~> 0.9)
rouge (~> 3.0)
rouge (>= 3.0, < 5.0)
safe_yaml (~> 1.0)
terminal-table (~> 1.8)
terminal-table (>= 1.8, < 4.0)
webrick (~> 1.7)
jekyll-paginate (1.1.0)
jekyll-sass-converter (2.2.0)
sassc (> 2.0.1, < 3.0)
jekyll-redirect-from (0.16.0)
jekyll (>= 3.3, < 5.0)
jekyll-sass-converter (3.0.0)
sass-embedded (~> 1.54)
jekyll-watch (2.2.1)
listen (~> 3.0)
json (2.6.2)
kramdown (2.3.2)
json (2.6.3)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.3)
listen (3.7.1)
liquid (4.0.4)
listen (3.8.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.3.6)
mini_portile2 (2.8.1)
mercenary (0.4.0)
mini_portile2 (2.8.4)
minitest (5.16.3)
nokogiri (1.13.10)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
nokogiri (1.13.10-x86_64-darwin)
racc (~> 1.4)
parallel (1.22.1)
parser (3.1.2.1)
parallel (1.23.0)
parser (3.2.2.4)
ast (~> 2.4.1)
racc
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.7)
racc (1.6.2)
public_suffix (5.0.3)
racc (1.7.1)
rainbow (3.1.1)
rake (13.0.6)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
regexp_parser (2.6.0)
rexml (3.2.5)
rouge (3.26.0)
regexp_parser (2.8.1)
rexml (3.2.6)
rouge (4.1.3)
rspec (3.11.0)
rspec-core (~> 3.11.0)
rspec-expectations (~> 3.11.0)
Expand All @@ -83,7 +89,7 @@ GEM
rspec-expectations (3.11.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-mocks (3.11.1)
rspec-mocks (3.11.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-support (3.11.1)
Expand All @@ -99,16 +105,19 @@ GEM
rubocop-ast (>= 1.20.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.21.0)
parser (>= 3.1.1.0)
ruby-progressbar (1.11.0)
rubocop-ast (1.29.0)
parser (>= 3.2.1.0)
ruby-progressbar (1.13.0)
safe_yaml (1.0.5)
sassc (2.4.0)
ffi (~> 1.9)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
unicode-display_width (1.8.0)
webrick (1.7.0)
sass-embedded (1.68.0)
google-protobuf (~> 3.23)
rake (>= 13.0.0)
sass-embedded (1.68.0-x86_64-darwin)
google-protobuf (~> 3.23)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
unicode-display_width (2.5.0)
webrick (1.8.1)

PLATFORMS
ruby
Expand All @@ -118,6 +127,7 @@ DEPENDENCIES
jekyll
jekyll-paginate
jekyll-polyglot!
jekyll-redirect-from
minitest (~> 5.16.3)
nokogiri (~> 1.13.10)
rake
Expand Down
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,32 +69,35 @@ In short:


#### Using different permalinks per language
_New in 1.7.0_

Optionally, for those who may want different URLs on different laguages, translations may be identified by specifying a `lang_id` in the frontmatter.
Optionally, for those who may want different URLs on different languages, translations may be identified by specifying a `page_id` in the frontmatter.

If available, polyglot will use `lang_id` and will default to the `permalink` otherwise.
If available, polyglot will use `page_id` to identify the page, and will default to the `permalink` otherwise.

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 `lang_id` that will link the files as translations:
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:
```md
---
title: About
permalink: /about/
permalink: /about
lang: en
lang_id: about
page_id: about
---
This is us!
```

```md
---
title: Acerca de
permalink: /acerca-de/
permalink: /acerca-de
lang: es
lang_id: about
page_id: about
---
Estos somos nosotros!
```

Additionally, if you are also using the `jekyll-redirect-from` plugin, pages coordinated this way will automatically have redirects created between pages.
So `/es/about` will automatically redirect to `/es/acerca-de` and `/acerca-de` can redirect to `/about`. If you use this approach, be sure to also employ a customized [redirect.html](https://github.com/untra/polyglot/blob/master/site/_layouts/redirect.html).

#### Fallback Language Support
Lets say you are building your website. You have an `/about/` page written in *english*, *german* and
Expand Down
4 changes: 2 additions & 2 deletions jekyll-polyglot.gemspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Gem::Specification.new do |s|
s.name = 'jekyll-polyglot'
s.version = '1.6.0'
s.date = '2023-06-08'
s.version = '1.7.0'
s.date = '2023-10-29'
s.summary = 'I18n plugin for Jekyll Blogs'
s.description = 'Fast open source i18n plugin for Jekyll blogs.'
s.authors = ['Samuel Volin']
Expand Down
Loading

0 comments on commit 30fba11

Please sign in to comment.