jekyll-polyglot 1.2.4 → 1.4.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
- SHA1:
3
- metadata.gz: 526e59c26e6980628a9518162f6787e3b844d012
4
- data.tar.gz: 526882c53b913ff61c2cb2722897a77bbb66c9fa
2
+ SHA256:
3
+ metadata.gz: 37bbf459ea94dd1edd9fbef3aeb136db17a68b78b58a1b983d8bbc2cbe24727b
4
+ data.tar.gz: 5148941f48e63247596579130b8dbd8c407be7e326a2cc59b98725291d9f564d
5
5
  SHA512:
6
- metadata.gz: 0dc16249857ec6caf827301a61cfb73397ee33a45fab94697ec948da5196950eeb94161362a36caed5ecac667a6261c4a7b5dba7d5ebdd3988a31130c152a0af
7
- data.tar.gz: 0f902861343803834c3c9b01aca95b9ed2969d77e076c7658de5755aa00879a147cfbf94c1f4e61fbf8c34c788418db77e22e287d80d212c551e0315cd54d164
6
+ metadata.gz: 303584c6688bf73fb8fc15a8c6bb160b0ae2b055744bdac4a3515455343a20dfbccff2d5713e74f2dca6235f0ed40e0b5d9a7f230a9a57f4b007ae2b0bd5fc8b
7
+ data.tar.gz: de6caa20d33315f63c8f7f6da8800e83aa2f77548a8d21ed8bf4e8c7529d16ee96813eaef4d46fc9885867c03ae3b48e9681af041fda8c21e645ed8fbf560aaa
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2015 - 2016 Samuel Volin
1
+ Copyright (c) 2015 - 2020 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
@@ -18,7 +18,7 @@ end
18
18
 
19
19
  Or install the gem manually by doing `gem install jekyll-polyglot` and specify the plugin using `_config.yml`:
20
20
  ```YAML
21
- gems:
21
+ plugins:
22
22
  - jekyll-polyglot
23
23
  ```
24
24
 
@@ -27,15 +27,20 @@ In your `_config.yml` file, add the following preferences
27
27
  ```YAML
28
28
  languages: ["en", "sv", "de", "fr"]
29
29
  default_lang: "en"
30
- exclude_from_localization: ["javascript", "images", "css"]
30
+ exclude_from_localization: ["javascript", "images", "css", "README.md"]
31
31
  parallel_localization: true
32
32
  ```
33
33
  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
- - what root level folders are you excluding from localization
36
+ - what root level files/folders are excluded from localization, based
37
+ on if their paths start with any of the excluded regexp substrings
37
38
  - whether to run language processing in parallel or serial
38
39
 
40
+ The optional `lang_from_path: true` option enables getting page
41
+ language from the first or second path segment, e.g `de/first-one.md`, or
42
+ `_posts/zh_Hans_HK/use-second-segment.md` , if the lang frontmatter isn't defined.
43
+
39
44
  ## How To Use It
40
45
  When adding new posts and pages, add to the YAML front matter:
41
46
  ```
@@ -89,8 +94,63 @@ becomes
89
94
  ```
90
95
  Notice the link `<a href="/fr/menu/">...` directs to the french website.
91
96
 
92
- Even if you are falling back to `default_lang` page, relative links built on the *french* site will
93
- still link to *french* pages.
97
+ Even if you are falling back to `default_lang` page, relative links built on the *french* site will still link to *french* pages.
98
+
99
+ #### Relativized Absolute Urls
100
+ If you defined a site `url` in your `_config.yaml`, polyglot will automatically relativize absolute links pointing to your website directory:
101
+
102
+ ```md
103
+ ---
104
+ lang: fr
105
+ ---
106
+ Cliquez [ici]({{site.url}}) pour aller à l'entrée du site.
107
+ ```
108
+ becomes
109
+ ```html
110
+ <p>Cliquez <a href="https://mywebsite.com/fr/">ici</a> pour aller à l'entrée du site.
111
+ ```
112
+
113
+ #### Disabling Url Relativizing
114
+ _New in 1.4.0_
115
+ 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 `{% static_href %}href="..."{% endstatic_href %}` block tag.
116
+
117
+ ```html
118
+ <a {% static_href %}href="/about"{% endstatic_href %}>click this static link</a>
119
+ ```
120
+
121
+ that will generate `<a href="/about">click this static link</a>` which is what you would normally use to create a url unmangled by invisible language relativization.
122
+
123
+ _Previous (no longer) Recommendation:_
124
+ If you don't want aa url to be relativized, you can add a space explicitly into the href to prevent a url from being relativized by polyglot.
125
+
126
+ For example, the following urls will be relativized:
127
+
128
+ ```html
129
+ href="http://mywebsite.com/about"
130
+ href="/about"
131
+ ```
132
+
133
+ and the following urls will be left alone:
134
+
135
+ ```html
136
+ href=" http://mywebsite.com/about"
137
+ href=" /about"
138
+ ```
139
+
140
+ combine with a [html minifier](https://github.com/digitalsparky/jekyll-minifier) for a polished and production ready website. -->
141
+
142
+ #### Exclusive site language generation
143
+ _New in 1.4.0_
144
+
145
+ If you want to control which languages a document can be generated for, you can specify `lang-exclusive: [ ]` frontmatter.
146
+ If you include this frontmatter in your post, it will only generate for the specified site languages.
147
+
148
+ For Example, the following frontmatter will only generate in the `en` and `fr` site language builds:
149
+ ```
150
+ ---
151
+ lang-exclusive: ['en', 'fr']
152
+ ---
153
+ ```
94
154
 
95
155
  #### Localized site.data
96
156
 
@@ -109,25 +169,47 @@ This plugin stands out from other I18n Jekyll plugins.
109
169
  - builds all versions of your website *simultaneously*, allowing big websites to scale efficiently.
110
170
  - provides the liquid tag `{{ site.languages }}` to get an array of your I18n strings.
111
171
  - provides the liquid tag `{{ site.default_lang }}` to get the default_lang I18n string.
112
- - provides the liquid tag `{{ site.active_lang }}` to get the I18n language string the website was built for.
172
+ - provides the liquid tag `{{ site.active_lang }}` to get the I18n language string the website was built for. Alternative names for `active_lang` can be configured via `config.lang_vars`.
113
173
  - provides the liquid tag `{{ I18n_Headers https://yourwebsite.com/ }}` to append SEO bonuses to your website.
174
+ - provides the liquid tag `{{ Unrelativized_Link href="/hello" }}` to make urls that do not get influenced by url correction regexs.
114
175
  - provides `site.data` localization for efficient rich text replacement.
115
176
  - a creator that will answer all of your questions and issues.
116
177
 
117
178
  ## SEO Recipes
118
179
  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 it's multilingual audience. Check them out!
119
180
 
120
- ## Examples
121
- Check out the example project website [here](https://untra.github.io/polyglot)
122
- (Jekyll resources are on the project's [site](https://github.com/untra/polyglot/tree/master/site) directory)
123
-
124
181
  ### Other Websites Built with Polyglot
125
182
  let us know if you make a multilingual blog you want to share:
126
- * [LogRhythm Corporate Website](http://logrhythm.com)
183
+ * [Polyglot project website](https://polyglot.untra.io)
184
+ * [LogRhythm Corporate Website](https://logrhythm.com)
185
+ * [All Over Earth](https://allover.earth/)
186
+ * [Hanare Cafe in Toshijima, Japan](https://hanarecafe.com)
187
+ * [F-Droid](https://f-droid.org)
188
+ * [Ubuntu MATE](https://ubuntu-mate.org)
127
189
 
128
190
  ## Compatibility
129
- Currently supports Jekyll 3.0 .
130
- Windows users will need to disable parallel_localization on their machines by setting `parallel_localization: false` in the `_config.yml`
191
+ Currently supports Jekyll 3.0 , and Jekyll 4.0
192
+
193
+ * Windows users will need to disable parallel_localization on their machines by setting `parallel_localization: false` in the `_config.yml`
194
+ * 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:
195
+ ```yaml
196
+ sass:
197
+ sourcemap: never
198
+ ```
199
+
200
+ ## Contributions
201
+ Please! I need all the support I can get! 🙏
202
+ 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!
203
+ If you have something you'd like to contribute to jekyll-polyglot, please open a PR!
204
+
205
+ ## Roadmap
206
+ [ ] - **site language**: portuguese `pt_BR` `pt_PT`
207
+ [ ] - **site language**: arabic `ar`
208
+ [ ] - **site language**: japanese `ja`
209
+ [ ] - **site language**: russian `ru`
210
+ [ ] - **site language**: korean `ko`
211
+ [ ] - **site language**: hebrew `he`
212
+ [ ] - get whitelisted as an official github-pages jekyll plugin
131
213
 
132
214
  ## Copyright
133
- Copyright (c) Samuel Volin 2017. License: MIT
215
+ Copyright (c) Samuel Volin 2021. License: MIT
@@ -1,3 +1,2 @@
1
- require_relative 'hooks/assets-toggle'
2
1
  require_relative 'hooks/coordinate'
3
2
  require_relative 'hooks/process'
@@ -1,9 +1,21 @@
1
1
  # hook to coordinate blog posts and pages into distinct urls,
2
2
  # and remove duplicate multilanguage posts and pages
3
3
  Jekyll::Hooks.register :site, :post_read do |site|
4
+ hook_coordinate(site)
5
+ end
6
+
7
+ def hook_coordinate(site)
8
+ # Copy the language specific data, by recursively merging it with the default data.
9
+ # Favour active_lang first, then default_lang, then any non-language-specific data.
10
+ # See: https://www.ruby-forum.com/topic/142809
11
+ merger = proc { |key, v1, v2| Hash === v1 && Hash === v2 ? v1.merge(v2, &merger) : v2 }
12
+ if site.data.include?(site.default_lang)
13
+ site.data = site.data.merge(site.data[site.default_lang], &merger)
14
+ end
4
15
  if site.data.include?(site.active_lang)
5
- site.data = site.data.merge(site.data[site.active_lang])
16
+ site.data = site.data.merge(site.data[site.active_lang], &merger)
6
17
  end
18
+
7
19
  site.collections.each do |_, collection|
8
20
  collection.docs = site.coordinate_documents(collection.docs)
9
21
  end
@@ -1,5 +1,9 @@
1
1
  # hook to make a call to process rendered documents,
2
2
  Jekyll::Hooks.register :site, :post_render do |site|
3
+ hook_process(site)
4
+ end
5
+
6
+ def hook_process(site)
3
7
  site.collections.each do |_, collection|
4
8
  site.process_documents(collection.docs)
5
9
  end
@@ -1,7 +1,8 @@
1
1
  module Jekyll
2
2
  module Polyglot
3
3
  module Liquid
4
- require_relative 'liquid/tags/i18n-headers'
4
+ require_relative 'liquid/tags/i18n_headers'
5
+ require_relative 'liquid/tags/static_href'
5
6
  end
6
7
  end
7
8
  end
@@ -12,14 +12,15 @@ module Jekyll
12
12
  def render(context)
13
13
  site = context.registers[:site]
14
14
  permalink = context.registers[:page]['permalink']
15
- siteUrl = (@url.empty?) ? site.config['url'] : @url
16
- i18n = "<meta http-equiv=\"Content-Language\" content=\"#{site.active_lang}\">"
17
- i18n += "<link rel=\"alternate\" i18n=\"#{site.default_lang}\""\
18
- " href=\"#{siteUrl}#{permalink}\" />\n"
15
+ site_url = @url.empty? ? site.config['url'] : @url
16
+ i18n = "<meta http-equiv=\"Content-Language\" content=\"#{site.active_lang}\">\n"
17
+ i18n += "<link rel=\"alternate\" hreflang=\"#{site.default_lang}\" "\
18
+ "href=\" #{site_url}#{permalink}\"/>\n"
19
19
  site.languages.each do |lang|
20
20
  next if lang == site.default_lang
21
- i18n += "<link rel=\"alternate\" i18n=\"#{lang}\""\
22
- " href=\"#{siteUrl}/#{lang}#{permalink}\" />\n"
21
+
22
+ i18n += "<link rel=\"alternate\" hreflang=\"#{lang}\" "\
23
+ "href=\"#{site_url}/#{lang}#{permalink}\"/>\n"
23
24
  end
24
25
  i18n
25
26
  end
@@ -29,3 +30,4 @@ module Jekyll
29
30
  end
30
31
 
31
32
  Liquid::Template.register_tag('I18n_Headers', Jekyll::Polyglot::Liquid::I18nHeadersTag)
33
+ Liquid::Template.register_tag('i18n_headers', Jekyll::Polyglot::Liquid::I18nHeadersTag)
@@ -0,0 +1,27 @@
1
+ module Jekyll
2
+ module Polyglot
3
+ module Liquid
4
+ class StaticHrefTag < :: Liquid::Block
5
+ def initialize(tag_name, params, tokens)
6
+ super
7
+ end
8
+
9
+ def render(context)
10
+ text = super
11
+ href_attrs = text.strip.split '='
12
+ valid = (href_attrs.length == 2 && href_attrs[0] == 'href') && href_attrs[1].start_with?('"') && href_attrs[1].end_with?('"')
13
+ unless valid
14
+ raise Liquid::SyntaxError, "static_href parameters must include match href=\"...\" attribute param, eg. href=\"http://example.com\, href=\"/about\", href=\"/\" , instead got:\n#{text}"
15
+ end
16
+
17
+ href_value = href_attrs[1]
18
+ # href writes out as ferh="..." explicitly wrong, to be cauaght by seperate processor for nonrelativized links
19
+ "ferh=#{href_value}"
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+
26
+ Liquid::Template.register_tag('Static_Href', Jekyll::Polyglot::Liquid::StaticHrefTag)
27
+ Liquid::Template.register_tag('static_href', Jekyll::Polyglot::Liquid::StaticHrefTag)
@@ -1,41 +1,54 @@
1
1
  include Process
2
2
  module Jekyll
3
3
  class Site
4
- attr_reader :default_lang, :languages, :exclude_from_localization
4
+ attr_reader :default_lang, :languages, :exclude_from_localization, :lang_vars
5
5
  attr_accessor :file_langs, :active_lang
6
6
 
7
7
  def prepare
8
8
  @file_langs = {}
9
- @default_lang = config.fetch('default_lang', 'en')
10
- @languages = config.fetch('languages', ['en'])
9
+ fetch_languages
11
10
  @parallel_localization = config.fetch('parallel_localization', true)
12
- (@keep_files << @languages - [@default_lang]).flatten!
13
- @exclude_from_localization = config.fetch('exclude_from_localization', [])
11
+ @lang_from_path = config.fetch('lang_from_path', false)
12
+ @exclude_from_localization = config.fetch('exclude_from_localization', []).map do |e|
13
+ if File.directory?(e) && e[-1] != '/'
14
+ e + '/'
15
+ else
16
+ e
17
+ end
18
+ end
19
+ end
20
+
21
+ def fetch_languages
22
+ @default_lang = config.fetch('default_lang', 'en')
23
+ @languages = config.fetch('languages', ['en']).uniq
24
+ @keep_files += (@languages - [@default_lang])
14
25
  @active_lang = @default_lang
26
+ @lang_vars = config.fetch('lang_vars', [])
15
27
  end
16
28
 
17
29
  alias_method :process_orig, :process
18
30
  def process
19
31
  prepare
32
+ all_langs = (@languages + [@default_lang]).uniq
20
33
  if @parallel_localization
21
34
  pids = {}
22
- @languages.each do |lang|
35
+ all_langs.each do |lang|
23
36
  pids[lang] = fork do
24
37
  process_language lang
25
38
  end
26
39
  end
27
40
  Signal.trap('INT') do
28
- @languages.each do |lang|
41
+ all_langs.each do |lang|
29
42
  puts "Killing #{pids[lang]} : #{lang}"
30
43
  kill('INT', pids[lang])
31
44
  end
32
45
  end
33
- @languages.each do |lang|
46
+ all_langs.each do |lang|
34
47
  waitpid pids[lang]
35
48
  detach pids[lang]
36
49
  end
37
50
  else
38
- @languages.each do |lang|
51
+ all_langs.each do |lang|
39
52
  process_language lang
40
53
  end
41
54
  end
@@ -47,14 +60,28 @@ module Jekyll
47
60
  payload['site']['default_lang'] = default_lang
48
61
  payload['site']['languages'] = languages
49
62
  payload['site']['active_lang'] = active_lang
63
+ lang_vars.each do |v|
64
+ payload['site'][v] = active_lang
65
+ end
50
66
  payload
51
67
  end
52
68
 
53
69
  def process_language(lang)
54
70
  @active_lang = lang
55
71
  config['active_lang'] = @active_lang
56
- return process_orig if @active_lang == @default_lang
57
- process_active_language
72
+ lang_vars.each do |v|
73
+ config[v] = @active_lang
74
+ end
75
+ if @active_lang == @default_lang
76
+ then process_default_language
77
+ else process_active_language
78
+ end
79
+ end
80
+
81
+ def process_default_language
82
+ old_include = @include
83
+ process_orig
84
+ @include = old_include
58
85
  end
59
86
 
60
87
  def process_active_language
@@ -68,17 +95,42 @@ module Jekyll
68
95
  @exclude = old_exclude
69
96
  end
70
97
 
98
+ def derive_lang_from_path(doc)
99
+ if !@lang_from_path
100
+ return nil
101
+ end
102
+ segments = doc.relative_path.split('/')
103
+ if doc.relative_path[0] == '_' \
104
+ && segments.length > 2 \
105
+ && segments[1] =~ /^[a-z]{2,3}(:?[_-](:?[A-Za-z]{2}){1,2}){0,2}$/
106
+ return segments[1]
107
+ elsif segments.length > 1 \
108
+ && segments[0] =~ /^[a-z]{2,3}(:?[_-](:?[A-Za-z]{2}){1,2}){0,2}$/
109
+ return segments[0]
110
+ else
111
+ return nil
112
+ end
113
+ end
114
+
71
115
  # assigns natural permalinks to documents and prioritizes documents with
72
- # active_lang languages over others
116
+ # active_lang languages over others. If lang is not set in front matter,
117
+ # then this tries to derive from the path, if the lang_from_path is set.
118
+ # otherwise it will assign the document to the default_lang
73
119
  def coordinate_documents(docs)
74
120
  regex = document_url_regex
75
121
  approved = {}
76
122
  docs.each do |doc|
77
- lang = doc.data['lang'] || @default_lang
123
+ lang = doc.data['lang'] || derive_lang_from_path(doc) || @default_lang
124
+ lang_exclusive = doc.data['lang-exclusive'] || []
78
125
  url = doc.url.gsub(regex, '/')
79
126
  doc.data['permalink'] = url
127
+ # skip this document if it has already been processed
80
128
  next if @file_langs[url] == @active_lang
129
+ # skip this document if it has a fallback and it isn't assigned to the active language
81
130
  next if @file_langs[url] == @default_lang && lang != @active_lang
131
+ # skip this document if it has lang-exclusive defined and the active_lang is not included
132
+ next if !lang_exclusive.empty? && !lang_exclusive.include?(@active_lang)
133
+
82
134
  approved[url] = doc
83
135
  @file_langs[url] = lang
84
136
  end
@@ -87,8 +139,20 @@ module Jekyll
87
139
 
88
140
  # performs any necesarry operations on the documents before rendering them
89
141
  def process_documents(docs)
142
+ # return if @active_lang == @default_lang
143
+
144
+ url = config.fetch('url', false)
145
+ rel_regex = relative_url_regex(false)
146
+ abs_regex = absolute_url_regex(url, false)
147
+ non_rel_regex = relative_url_regex(true)
148
+ non_abs_regex = absolute_url_regex(url, true)
90
149
  docs.each do |doc|
91
- relativize_urls doc
150
+ unless @active_lang == @default_lang then relativize_urls(doc, rel_regex) end
151
+ correct_nonrelativized_urls(doc, non_rel_regex)
152
+ if url
153
+ unless @active_lang == @default_lang then relativize_absolute_urls(doc, abs_regex, url) end
154
+ correct_nonrelativized_absolute_urls(doc, non_abs_regex, url)
155
+ end
92
156
  end
93
157
  end
94
158
 
@@ -105,21 +169,63 @@ module Jekyll
105
169
  end
106
170
 
107
171
  # a regex that matches relative urls in a html document
108
- # matches href="baseurl/foo/bar-baz" and others like it
109
- # avoids matching excluded files
110
- def relative_url_regex
172
+ # matches href="baseurl/foo/bar-baz" href="/foo/bar-baz" and others like it
173
+ # avoids matching excluded files. prepare makes sure
174
+ # that all @exclude dirs have a trailing slash.
175
+ def relative_url_regex(disabled = false)
176
+ regex = ''
177
+ unless disabled
178
+ @exclude.each do |x|
179
+ regex += "(?!#{x})"
180
+ end
181
+ @languages.each do |x|
182
+ regex += "(?!#{x}\/)"
183
+ end
184
+ end
185
+ start = disabled ? 'ferh' : 'href'
186
+ %r{#{start}=\"?#{@baseurl}\/((?:#{regex}[^,'\"\s\/?\.#]+\.?)*(?:\/[^\]\[\)\(\"\'\s]*)?)\"}
187
+ end
188
+
189
+ # a regex that matches absolute urls in a html document
190
+ # matches href="http://baseurl/foo/bar-baz" and others like it
191
+ # avoids matching excluded files. prepare makes sure
192
+ # that all @exclude dirs have a trailing slash.
193
+ def absolute_url_regex(url, disabled = false)
111
194
  regex = ''
112
- @exclude.each do |x|
113
- regex += "(?!#{x}\/)"
195
+ unless disabled
196
+ @exclude.each do |x|
197
+ regex += "(?!#{x})"
198
+ end
199
+ @languages.each do |x|
200
+ regex += "(?!#{x}\/)"
201
+ end
114
202
  end
115
- url_quoted = config['url']
116
- url_quoted = Regexp.quote(url_quoted) unless url_quoted.nil?
117
- %r{href=\"(?:#{url_quoted})?#{@baseurl}\/((?:#{regex}[^,'\"\s\/?\.#]+\.?)*(?:\/[^\]\[\)\(\"\'\s]*)?)\"}
203
+ start = disabled ? 'ferh' : 'href'
204
+ %r{#{start}=\"?#{url}#{@baseurl}\/((?:#{regex}[^,'\"\s\/?\.#]+\.?)*(?:\/[^\]\[\)\(\"\'\s]*)?)\"}
118
205
  end
119
206
 
120
- def relativize_urls(doc)
121
- return if @active_lang == @default_lang
122
- doc.output.gsub!(relative_url_regex, "href=\"#{@baseurl}/#{@active_lang}/" + '\1"')
207
+ def relativize_urls(doc, regex)
208
+ return if doc.output.nil?
209
+
210
+ doc.output.gsub!(regex, "href=\"#{@baseurl}/#{@active_lang}/" + '\1"')
211
+ end
212
+
213
+ def relativize_absolute_urls(doc, regex, url)
214
+ return if doc.output.nil?
215
+
216
+ doc.output.gsub!(regex, "href=\"#{url}#{@baseurl}/#{@active_lang}/" + '\1"')
217
+ end
218
+
219
+ def correct_nonrelativized_absolute_urls(doc, regex, url)
220
+ return if doc.output.nil?
221
+
222
+ doc.output.gsub!(regex, "href=\"#{url}#{@baseurl}/" + '\1"')
223
+ end
224
+
225
+ def correct_nonrelativized_urls(doc, regex)
226
+ return if doc.output.nil?
227
+
228
+ doc.output.gsub!(regex, "href=\"#{@baseurl}/" + '\1"')
123
229
  end
124
230
  end
125
231
  end
@@ -1,5 +1,5 @@
1
1
  module Jekyll
2
2
  module Polyglot
3
- VERSION="1.2.4"
3
+ VERSION = '1.3.3'.freeze
4
4
  end
5
5
  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.2.4
4
+ version: 1.4.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: 2016-07-22 00:00:00.000000000 Z
11
+ date: 2021-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -17,9 +17,6 @@ dependencies:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '3.0'
20
- - - "~>"
21
- - !ruby/object:Gem::Version
22
- version: '3.1'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
@@ -27,9 +24,6 @@ dependencies:
27
24
  - - ">="
28
25
  - !ruby/object:Gem::Version
29
26
  version: '3.0'
30
- - - "~>"
31
- - !ruby/object:Gem::Version
32
- version: '3.1'
33
27
  description: Fast open source i18n plugin for Jekyll blogs.
34
28
  email: untra.sam@gmail.com
35
29
  executables: []
@@ -45,12 +39,13 @@ files:
45
39
  - lib/jekyll/polyglot/hooks/coordinate.rb
46
40
  - lib/jekyll/polyglot/hooks/process.rb
47
41
  - lib/jekyll/polyglot/liquid.rb
48
- - lib/jekyll/polyglot/liquid/tags/i18n-headers.rb
42
+ - lib/jekyll/polyglot/liquid/tags/i18n_headers.rb
43
+ - lib/jekyll/polyglot/liquid/tags/static_href.rb
49
44
  - lib/jekyll/polyglot/patches.rb
50
45
  - lib/jekyll/polyglot/patches/jekyll/site.rb
51
46
  - lib/jekyll/polyglot/patches/jekyll/static_file.rb
52
47
  - lib/jekyll/polyglot/version.rb
53
- homepage: http://untra.github.io/polyglot
48
+ homepage: https://polyglot.untra.io/
54
49
  licenses:
55
50
  - MIT
56
51
  metadata: {}
@@ -62,15 +57,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
62
57
  requirements:
63
58
  - - ">="
64
59
  - !ruby/object:Gem::Version
65
- version: '0'
60
+ version: 2.4.0
66
61
  required_rubygems_version: !ruby/object:Gem::Requirement
67
62
  requirements:
68
63
  - - ">="
69
64
  - !ruby/object:Gem::Version
70
- version: '0'
65
+ version: 2.7.0
71
66
  requirements: []
72
- rubyforge_project:
73
- rubygems_version: 2.5.2
67
+ rubygems_version: 3.2.7
74
68
  signing_key:
75
69
  specification_version: 4
76
70
  summary: I18n plugin for Jekyll Blogs