octopress-multilingual 0.0.6 → 0.0.7

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: e31571f420ab5d1cfc9e2ce4acf3b7f8b18edb69
4
- data.tar.gz: 2c7b824b3dc4ea330d15d95a51edce0a9dd9785a
3
+ metadata.gz: 1ddd7536d8cb455af461184f5861d2c2384c4af6
4
+ data.tar.gz: f1d4232c1b20da1e832b866178e8fa245114b81d
5
5
  SHA512:
6
- metadata.gz: e7de843a153b09bc68e532a9d65eb1d1f57ce13593b5050516eb289aed4a0a44d75b024f261b07990abc6e2d4801ec088728e2d30ae8440286ab2227f5c46429
7
- data.tar.gz: e7a3105e08ec75ef940954a06a44f164a680bb26647d92d52ecb655d6d60011fdb8ad1d992e5c6da2880fdd33ad7244876f6428b7c19d011f795abd32cc8c7d2
6
+ metadata.gz: 0292321bf1138654367fb33650b8b43d0117703084d81d51b476e9686f8d88e1f7e5c8a662102a28749aeb5a8c55f0a8c811eb0cb8c05d99543fc05fac25cf25
7
+ data.tar.gz: 9ca4ea2e92f1351d5455c29e4e989c8afadbc571146eabd3b927ead584cdecf64272511630c662ea4012544d5a965d3aa425206b8dcc80eb2801e84a5c0c4a72
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ### 0.0.7 (2015-01-21)
4
+
5
+ - Fix: If no posts had been defined with the main language, posts would disappear. Most embarrassing.
6
+ - Change: instead of `site.main_language`, now using `site.lang`.
7
+
3
8
  ### 0.0.6 (2015-01-20)
4
9
 
5
10
  - Reversed post order (as it should be)
data/README.md CHANGED
@@ -38,7 +38,7 @@ problem with an Octopress plugin supporting your multilingual site, please file
38
38
 
39
39
  When adding this plugin to your site, you will need to:
40
40
 
41
- 1. Configure your site's main language, e.g. `main_language: en`.
41
+ 1. Configure your site's main language, e.g. `lang: en`.
42
42
  2. Add a language to the YAML front-matter of your posts, e.g. `lang: de`.
43
43
  3. Add new RSS feeds and post indexes for secondary languages.
44
44
 
@@ -51,7 +51,7 @@ Note: This guide will only cover the steps listed above. Your site may still hav
51
51
  First, be sure to configure your Jekyll site's main language, for example:
52
52
 
53
53
  ```yaml
54
- main_language: en
54
+ lang: en
55
55
  ```
56
56
 
57
57
  Here we are setting the default language to English. Posts without a defined language will be treated as English posts.
@@ -8,12 +8,12 @@ module Octopress
8
8
  attr_accessor :site, :posts
9
9
 
10
10
  def main_language
11
- if @lang ||= site.config['main_language']
11
+ if @lang ||= site.config['lang']
12
12
  @lang.downcase
13
13
  else
14
14
  abort "Build canceled by Octopress Multilingual.\n".red \
15
15
  << "Your Jekyll site configuration must have a main language. For example:\n\n" \
16
- << " main_language: en\n\n"
16
+ << " lang: en\n\n"
17
17
  end
18
18
  end
19
19
 
@@ -30,12 +30,13 @@ module Octopress
30
30
  posts = site.posts.reverse.select(&:lang).group_by(&:lang) \
31
31
  ## Add posts that crosspost to all languages
32
32
  .each do |lang, posts|
33
- if lang == main_language
34
- posts.clear.concat(main_language_posts)
35
- else
33
+ if lang != main_language
36
34
  posts.concat(crossposts).sort_by(&:date).reverse
37
35
  end
38
36
  end
37
+
38
+ posts[main_language] = main_language_posts
39
+
39
40
  posts
40
41
  end
41
42
  end
@@ -69,8 +70,7 @@ module Octopress
69
70
  payload = {
70
71
  'posts' => main_language_posts,
71
72
  'posts_by_language' => posts_by_language,
72
- 'languages' => languages,
73
- 'lang' => main_language
73
+ 'languages' => languages
74
74
  }
75
75
 
76
76
  if defined? Octopress::Linkblog
@@ -12,7 +12,7 @@ module Octopress
12
12
  @context = context
13
13
  @languages = @context['site.languages']
14
14
  @lang_posts = @context['site.posts_by_language']
15
- main_lang = @context['site.main_language']
15
+ main_lang = @context['site.lang']
16
16
 
17
17
  # Render with new posts context
18
18
  if lang
@@ -1,5 +1,5 @@
1
1
  module Octopress
2
2
  module Multilingual
3
- VERSION = "0.0.6"
3
+ VERSION = "0.0.7"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octopress-multilingual
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Mathis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-21 00:00:00.000000000 Z
11
+ date: 2015-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octopress-hooks