jekyll-localization 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README +1 -1
- data/lib/jekyll/localization.rb +13 -10
- data/lib/jekyll/localization/version.rb +1 -1
- metadata +7 -9
data/README
CHANGED
data/lib/jekyll/localization.rb
CHANGED
@@ -71,7 +71,9 @@ module Jekyll
|
|
71
71
|
initialize_without_localization(*args)
|
72
72
|
|
73
73
|
if @lang = extract_lang(@name)
|
74
|
-
data['lang']
|
74
|
+
data['lang'] = @lang
|
75
|
+
data['content_lang'] ||= @lang
|
76
|
+
|
75
77
|
@lang_ext = ".#{@lang}"
|
76
78
|
end
|
77
79
|
end
|
@@ -90,23 +92,22 @@ module Jekyll
|
|
90
92
|
basename, lang, ext = extract_lang(name, true)
|
91
93
|
return unless lang
|
92
94
|
|
93
|
-
|
95
|
+
original_data = data # keep original YAML data!
|
94
96
|
|
95
97
|
(LANGUAGES - [lang]).each { |alternate_lang|
|
96
98
|
alternate_name = [basename, alternate_lang, ext].join('.')
|
97
99
|
|
98
100
|
if File.exists?(File.join(base, alternate_name))
|
99
101
|
read_yaml(base, alternate_name, false)
|
100
|
-
break unless content.empty?
|
101
|
-
end
|
102
|
-
}
|
103
102
|
|
104
|
-
|
105
|
-
|
106
|
-
|
103
|
+
unless content.empty?
|
104
|
+
data['content_lang'] = alternate_lang
|
105
|
+
break
|
106
|
+
end
|
107
|
+
end
|
107
108
|
}
|
108
109
|
|
109
|
-
|
110
|
+
data.update(original_data)
|
110
111
|
end
|
111
112
|
|
112
113
|
end
|
@@ -215,7 +216,9 @@ module Jekyll
|
|
215
216
|
end
|
216
217
|
|
217
218
|
def url_lang(url, lang)
|
218
|
-
url.sub(Localization::LANG_END_RE, '
|
219
|
+
url = url.sub(Localization::LANG_END_RE, '')
|
220
|
+
url << '.' << lang if lang
|
221
|
+
url
|
219
222
|
end
|
220
223
|
|
221
224
|
def local_posts
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-localization
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jens Wille
|
@@ -16,8 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-
|
20
|
-
default_executable:
|
19
|
+
date: 2011-04-12 00:00:00 Z
|
21
20
|
dependencies:
|
22
21
|
- !ruby/object:Gem::Dependency
|
23
22
|
name: jekyll-rendering
|
@@ -52,7 +51,6 @@ files:
|
|
52
51
|
- ChangeLog
|
53
52
|
- Rakefile
|
54
53
|
- COPYING
|
55
|
-
has_rdoc: true
|
56
54
|
homepage: http://github.com/blackwinter/jekyll-localization
|
57
55
|
licenses: []
|
58
56
|
|
@@ -61,11 +59,11 @@ rdoc_options:
|
|
61
59
|
- --charset
|
62
60
|
- UTF-8
|
63
61
|
- --title
|
64
|
-
- jekyll-localization Application documentation (v0.1.
|
62
|
+
- jekyll-localization Application documentation (v0.1.1)
|
65
63
|
- --main
|
66
64
|
- README
|
67
|
-
- --all
|
68
65
|
- --line-numbers
|
66
|
+
- --all
|
69
67
|
require_paths:
|
70
68
|
- lib
|
71
69
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -89,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
89
87
|
requirements: []
|
90
88
|
|
91
89
|
rubyforge_project:
|
92
|
-
rubygems_version: 1.
|
90
|
+
rubygems_version: 1.7.2
|
93
91
|
signing_key:
|
94
92
|
specification_version: 3
|
95
93
|
summary: Jekyll plugin that adds localization features to the rendering engine.
|