octopress-feeds 1.2.5 → 1.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +13 -2
- data/lib/octopress-feeds/config-asset.rb +22 -0
- data/lib/octopress-feeds/tags.rb +3 -4
- data/lib/octopress-feeds/version.rb +1 -1
- data/lib/octopress-feeds.rb +5 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71bee0e15a5b3f5e34b414c4c2c6d89e8c06bb89
|
4
|
+
data.tar.gz: 34990d035956040f710ecbd122834cf9d6677fb1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4f20f380fc274eef3c11dca8dfbaefba9b96830a0b03eb3af0613f4b552b467ccda5f264733cd279d566d22c3ffe05706eeecc151ac906cd6d8d54fd9aa434b6
|
7
|
+
data.tar.gz: d5e973edb2bfa19ac32f6b6061d38e128196556e862f7d626bfb4d84d40460b7db8568d8c3571e9c59db78b9bf9933524b73383380b134085de76089f5c272ac
|
data/CHANGELOG.md
CHANGED
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),
|
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
|
-
|
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
|
data/lib/octopress-feeds/tags.rb
CHANGED
@@ -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
|
7
|
-
.sort_by { |p| p.
|
8
|
-
.
|
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
|
|
data/lib/octopress-feeds.rb
CHANGED
@@ -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.
|
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-
|
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
|