octopress-feeds 1.2.5 → 1.2.6

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: abd728ec448b8e141757d5f6182aae70a3e8556c
4
- data.tar.gz: a5bf1c25a69d11bb40d633b7a159fe4080c673b2
3
+ metadata.gz: 71bee0e15a5b3f5e34b414c4c2c6d89e8c06bb89
4
+ data.tar.gz: 34990d035956040f710ecbd122834cf9d6677fb1
5
5
  SHA512:
6
- metadata.gz: 0022830a0f430dd5ec1e3fb6f6d2d5f3139475eec936ea524eab0b9607645e9624cd8e7e3e5b8741697943fe2fa61fc3f6ba7018a242a0cb440c299d5a3b7ec6
7
- data.tar.gz: 2e98b682b48988a9c3d34299471cfa0389f643a4c03959dd0515e74fda81dfd4c9e695e306e51ebfd59b2e226fafd441d6a3153822eea6f386746a3f894c7143
6
+ metadata.gz: 4f20f380fc274eef3c11dca8dfbaefba9b96830a0b03eb3af0613f4b552b467ccda5f264733cd279d566d22c3ffe05706eeecc151ac906cd6d8d54fd9aa434b6
7
+ data.tar.gz: d5e973edb2bfa19ac32f6b6061d38e128196556e862f7d626bfb4d84d40460b7db8568d8c3571e9c59db78b9bf9933524b73383380b134085de76089f5c272ac
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ### 1.2.6 (2015-01-27)
4
+
5
+ - On multilanguage sites, the main language feed URL will default to `/[lang]/feed/index.xml`
6
+
3
7
  ### 1.2.5 (2015-01-26)
4
8
 
5
9
  - Fix: Feed excerpts work with linkblog and multilingual sites.
data/README.md CHANGED
@@ -67,9 +67,20 @@ Install [octopress-linkblog](https://github.com/octopress/linkblog) and posts wi
67
67
 
68
68
  ## Multilingual support
69
69
 
70
- If you are using [octopress-multilingual](https://github.com/octopress/multilingual), adding a secondary language feed is pretty simple. Let's say your primary language is English, but you want to add a German feed. Here's what you'd do.
70
+ If you are using [octopress-multilingual](https://github.com/octopress/multilingual), your feed urls will be organized by language. If
71
+ your site's main language is `en` your English feeds will be here:
71
72
 
72
- First, create a language feed at `/de/feed/index.xml` (or whatever path suits your site) and add the following.
73
+ ```
74
+ /en/feed/index.xml # All English posts feed
75
+ /en/links/index.xml # English link posts (if using octopress-linkblog)
76
+ /en/articles/index.xml # English article posts (if using octopress-linkblog)
77
+ ```
78
+
79
+ To change the URL for these pages, read the [Feed Permalinks](#feed-permalinks) section below.
80
+
81
+ Adding a secondary language feed is pretty simple. Let's say you want to add a German language feed. Here's what you'd do.
82
+
83
+ First, create a page at `/de/feed/index.xml` (or whatever path suits your site's URL conventions) and add the following.
73
84
 
74
85
  ```
75
86
  ---
@@ -0,0 +1,22 @@
1
+ module Octopress
2
+ module Feeds
3
+ class Config < Ink::Assets::Config
4
+ def read
5
+ config = super
6
+ if defined? Octopress::Multilingual
7
+ config = Jekyll::Utils.deep_merge_hashes(multilingual_permalinks, config)
8
+ end
9
+ config
10
+ end
11
+
12
+ def multilingual_permalinks
13
+ lang = Octopress.site.config['lang']
14
+ { "permalinks" => {
15
+ "main-feed" => "/#{lang}/feed/",
16
+ "link-feed" => "/#{lang}/feed/links/",
17
+ "article-feed" => "/#{lang}/feed/articles/"
18
+ }}
19
+ end
20
+ end
21
+ end
22
+ end
@@ -3,10 +3,9 @@ module Octopress
3
3
  class FeedTag < Liquid::Tag
4
4
  def render(context)
5
5
  context['site.pages'].dup \
6
- .select { |p| p.data['feed'] } \
7
- .sort_by { |p| p.url } \
8
- .sort_by { |p| p.url.size } \
9
- .map { |p| tag(p) } \
6
+ .select { |p| p.data['feed'] } \
7
+ .sort_by { |p| p.path.size } \
8
+ .map { |p| tag(p) } \
10
9
  .join("\n")
11
10
  end
12
11
 
@@ -1,5 +1,5 @@
1
1
  module Octopress
2
2
  module Feeds
3
- VERSION = "1.2.5"
3
+ VERSION = "1.2.6"
4
4
  end
5
5
  end
@@ -5,12 +5,17 @@ require 'octopress-abort-tag'
5
5
  require 'octopress-return-tag'
6
6
  require 'octopress-date-format'
7
7
  require 'octopress-feeds/tags'
8
+ require 'octopress-feeds/config-asset'
8
9
 
9
10
 
10
11
  module Octopress
11
12
  module Feeds
12
13
  class Plugin < Ink::Plugin
13
14
 
15
+ def config_defaults
16
+ @config ||= Feeds::Config.new(self, @config_file)
17
+ end
18
+
14
19
  def add_pages
15
20
  super
16
21
 
@@ -35,5 +40,3 @@ Octopress::Ink::Plugins.register_plugin(Octopress::Feeds::Plugin, {
35
40
  description: "RSS feeds for Jekyll sites, featuring link-blogging and multilingual support",
36
41
  website: "https://github.com/octopress/feeds"
37
42
  })
38
-
39
-
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: octopress-feeds
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.5
4
+ version: 1.2.6
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-27 00:00:00.000000000 Z
11
+ date: 2015-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: octopress-ink
@@ -198,6 +198,7 @@ files:
198
198
  - assets/pages/link-feed.xml
199
199
  - assets/pages/main-feed.xml
200
200
  - lib/octopress-feeds.rb
201
+ - lib/octopress-feeds/config-asset.rb
201
202
  - lib/octopress-feeds/tags.rb
202
203
  - lib/octopress-feeds/version.rb
203
204
  homepage: https://github.com/octopress/feeds