octopress-multilingual 0.2.1 → 0.2.2

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
2
  SHA1:
3
- metadata.gz: 1cdb85708c9c83a005a9264293caa1191f194d9d
4
- data.tar.gz: a43cbabca0b124c02d65b4e821ee8e28b50a6138
3
+ metadata.gz: ae2a7d77082269627ef469a575b895949ae49989
4
+ data.tar.gz: 472a8cfecf409781c79272d665abc7df984c6236
5
5
  SHA512:
6
- metadata.gz: ca0756bc4340d208e966a4bc2f2826d1a28bcae42d57d589d0699d6f4b9a33a17533eef2ef12b3ac504918913a95a1ecbfd48ca9f9a0c1bb24245a62594c2b9c
7
- data.tar.gz: e70ab74c2c0ba7529c57288fade6d27eaa2655873ab4315d4e16229591c96c8c6322062df7c3794eb6ea42b451c570496d76b2bce5db95528edad356eab906e6
6
+ metadata.gz: 43a2416772b2c9af04bdc6913e3b8cd36232a39eb2c60fd0ce00ce01cf6671faf6a3c01caeac2410575e87babe11768020614bc31f55d239e4fb1858198383c5
7
+ data.tar.gz: 4cbbda31c6c4e7f00d1205fcb71f5bae2979901b59c4a7cda16e1e667de77d619eea38c4369218361255ce66c6e0f10173f9f1dbfc0fbd752f277097f21ab118
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ### 0.2.0 (2015-02-02)
4
+ - No longer necessary to abort if site language is not defined.
5
+
3
6
  ### 0.2.0 (2015-02-02)
4
7
  - Added a `language_name` method for retrieving a match from the language_names hash.
5
8
 
@@ -15,12 +15,10 @@ module Octopress
15
15
  attr_accessor :site
16
16
 
17
17
  def main_language
18
- if @lang ||= site.config['lang']
19
- @lang.downcase
20
- else
21
- abort "Build canceled by Octopress Multilingual.\n".red \
22
- << "Your Jekyll site configuration must have a main language. For example:\n\n" \
23
- << " lang: en\n\n"
18
+ @lang ||= begin
19
+ if lang = site.config['lang']
20
+ lang.downcase
21
+ end
24
22
  end
25
23
  end
26
24
 
@@ -29,11 +27,7 @@ module Octopress
29
27
  end
30
28
 
31
29
  def language_name(name=nil)
32
- if language = language_names[name]
33
- language
34
- else
35
- name
36
- end
30
+ language_names[name] || name
37
31
  end
38
32
 
39
33
  def language_names
@@ -133,17 +127,15 @@ module Octopress
133
127
 
134
128
  def site_payload
135
129
  # Skip when when showing documentation site
136
- if defined?(Octopress::Docs) && Octopress::Docs.enabled?
137
- {}
138
- else
139
- return unless main_language
140
-
130
+ if main_language
141
131
  @payload ||= {
142
132
  'posts_by_language' => posts_by_language,
143
133
  'linkposts_by_language' => linkposts_by_language,
144
134
  'articles_by_language' => articles_by_language,
145
135
  'languages' => languages
146
136
  }
137
+ else
138
+ {}
147
139
  end
148
140
  end
149
141
  end
@@ -1,5 +1,5 @@
1
1
  module Octopress
2
2
  module Multilingual
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octopress-multilingual
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis