jekyll-feed 0.9.2 → 0.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rubocop.yml +1 -1
- data/.travis.yml +8 -3
- data/Gemfile +3 -1
- data/History.markdown +18 -2
- data/LICENSE.txt +1 -1
- data/README.md +11 -1
- data/Rakefile +3 -1
- data/jekyll-feed.gemspec +12 -8
- data/lib/jekyll-feed.rb +2 -0
- data/lib/jekyll-feed/generator.rb +4 -2
- data/lib/jekyll-feed/meta-tag.rb +2 -0
- data/lib/jekyll-feed/page-without-a-file.rb +2 -0
- data/lib/jekyll-feed/version.rb +7 -0
- data/script/cibuild +2 -2
- data/script/fmt +10 -0
- data/script/test +4 -0
- data/spec/jekyll-feed_spec.rb +27 -0
- data/spec/spec_helper.rb +3 -3
- metadata +27 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: fc06c19cf7a822a53cc32bbf9cce036aeca5bf709a111830442897033811850d
|
4
|
+
data.tar.gz: c4729a2bfe3abb4490f32dcc04c6080259d3189c060f35af06242f5fa995ef7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 844acc55c1bc3d14bc9fe1f061acc6ed8be1f425dcb86eaa1a51de6ccbb590f4424a77203a0f6faf6791f9a6302fbcbd213f297768835fa6ae4323a873feb63b
|
7
|
+
data.tar.gz: 944201044de4e0efdcc0ac5fe5a8cb122a15f72c2b3526e757ce1f1a15c8771676978e506a1d7d2d1792a748ef73340c2602e41fdeef9f3f371cff7dbe485e91
|
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
@@ -1,13 +1,18 @@
|
|
1
1
|
language: ruby
|
2
|
+
cache: bundler
|
3
|
+
sudo: false
|
2
4
|
rvm:
|
5
|
+
- 2.5
|
6
|
+
- 2.4
|
7
|
+
- 2.3
|
3
8
|
- 2.2
|
4
9
|
env:
|
5
10
|
global:
|
6
11
|
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
|
7
|
-
|
8
|
-
|
12
|
+
before_install:
|
13
|
+
- gem update --system
|
9
14
|
before_script: bundle update
|
10
|
-
script:
|
15
|
+
script: script/cibuild
|
11
16
|
notifications:
|
12
17
|
email: false
|
13
18
|
deploy:
|
data/Gemfile
CHANGED
data/History.markdown
CHANGED
@@ -1,13 +1,29 @@
|
|
1
|
-
##
|
1
|
+
## 0.9.3 / 2018-02-04
|
2
|
+
|
3
|
+
* Define path with __dir (#187)
|
4
|
+
* Bump Ruby for Travis (#188)
|
2
5
|
|
3
6
|
### Documentation
|
4
7
|
|
5
|
-
*
|
8
|
+
* Fix: Add note about using plugins instead of gems key (#197)
|
9
|
+
* Add documentation for disabling smartify filter (#205)
|
10
|
+
|
11
|
+
### Development Fixes
|
12
|
+
|
13
|
+
* Rubocop: Target Ruby 2.2 (#195)
|
14
|
+
* Test feeds that have a `site.lang` (#164)
|
15
|
+
* Test against Ruby 2.5 (#201)
|
16
|
+
|
17
|
+
## 0.9.3 / 2017-03-28
|
6
18
|
|
7
19
|
### Minor Enhancements
|
8
20
|
|
9
21
|
* fix <entry> template for posts with post.lang defined (#168)
|
10
22
|
|
23
|
+
### Documentation
|
24
|
+
|
25
|
+
* Use `https` in more places. (#165)
|
26
|
+
|
11
27
|
## 0.9.1 / 2017-02-17
|
12
28
|
|
13
29
|
### Minor Enhancements
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -15,10 +15,12 @@ gem 'jekyll-feed'
|
|
15
15
|
And then add this line to your site's `_config.yml`:
|
16
16
|
|
17
17
|
```yml
|
18
|
-
|
18
|
+
plugins:
|
19
19
|
- jekyll-feed
|
20
20
|
```
|
21
21
|
|
22
|
+
:warning: If you are using Jekyll < 3.5.0 use the `gems` key instead of `plugins`.
|
23
|
+
|
22
24
|
## Usage
|
23
25
|
|
24
26
|
The plugin will automatically generate an Atom feed at `/feed.xml`.
|
@@ -122,6 +124,14 @@ The plugin exposes a helper tag to expose the appropriate meta tags to support a
|
|
122
124
|
|
123
125
|
The plugin uses [Jekyll's `smartify` filter](https://jekyllrb.com/docs/templates/) for processing the site title and post titles. This will translate plain ASCII punctuation into "smart" typographic punctuation. This will not render or strip any Markdown you may be using in a title.
|
124
126
|
|
127
|
+
Jekyll's `smartify` filter uses [kramdown](https://kramdown.gettalong.org/options.html) as a processor. Accordingly, if you do not want "smart" typographic punctuation, disabling them in kramdown in your `_config.yml` will disable them in your feed. For example:
|
128
|
+
|
129
|
+
```yml
|
130
|
+
kramdown:
|
131
|
+
smart_quotes: apos,apos,quot,quot
|
132
|
+
typographic_symbols: {hellip: ...}
|
133
|
+
```
|
134
|
+
|
125
135
|
### Custom styling
|
126
136
|
|
127
137
|
Want to style what your feed looks like in the browser? Simply add an XSLT at `/feed.xslt.xml` and Jekyll Feed will link to the stylesheet.
|
data/Rakefile
CHANGED
data/jekyll-feed.gemspec
CHANGED
@@ -1,8 +1,12 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path("lib", __dir__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require "jekyll-feed/version"
|
2
6
|
|
3
7
|
Gem::Specification.new do |spec|
|
4
8
|
spec.name = "jekyll-feed"
|
5
|
-
spec.version =
|
9
|
+
spec.version = Jekyll::Feed::VERSION
|
6
10
|
spec.authors = ["Ben Balter"]
|
7
11
|
spec.email = ["ben.balter@github.com"]
|
8
12
|
spec.summary = "A Jekyll plugin to generate an Atom feed of your Jekyll posts"
|
@@ -10,16 +14,16 @@ Gem::Specification.new do |spec|
|
|
10
14
|
spec.license = "MIT"
|
11
15
|
|
12
16
|
spec.files = `git ls-files -z`.split("\x0")
|
13
|
-
spec.executables = spec.files.grep(%r
|
14
|
-
spec.test_files = spec.files.grep(%r
|
17
|
+
spec.executables = spec.files.grep(%r!^bin/!) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r!^(test|spec|features)/!)
|
15
19
|
spec.require_paths = ["lib"]
|
16
20
|
|
17
21
|
spec.add_dependency "jekyll", "~> 3.3"
|
18
22
|
|
19
|
-
spec.add_development_dependency "bundler", "~> 1.
|
20
|
-
spec.add_development_dependency "
|
23
|
+
spec.add_development_dependency "bundler", "~> 1.15"
|
24
|
+
spec.add_development_dependency "nokogiri", "~> 1.6"
|
25
|
+
spec.add_development_dependency "rake", "~> 12.0"
|
21
26
|
spec.add_development_dependency "rspec", "~> 3.0"
|
27
|
+
spec.add_development_dependency "rubocop", "0.51"
|
22
28
|
spec.add_development_dependency "typhoeus", "~> 0.7"
|
23
|
-
spec.add_development_dependency "nokogiri", "~> 1.6"
|
24
|
-
spec.add_development_dependency "rubocop"
|
25
29
|
end
|
data/lib/jekyll-feed.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module JekyllFeed
|
2
4
|
class Generator < Jekyll::Generator
|
3
5
|
safe true
|
@@ -29,7 +31,7 @@ module JekyllFeed
|
|
29
31
|
|
30
32
|
# Path to feed.xml template file
|
31
33
|
def feed_source_path
|
32
|
-
File.expand_path "
|
34
|
+
File.expand_path "feed.xml", __dir__
|
33
35
|
end
|
34
36
|
|
35
37
|
# Checks if a file already exists in the site source
|
@@ -43,7 +45,7 @@ module JekyllFeed
|
|
43
45
|
|
44
46
|
# Generates contents for a file
|
45
47
|
def content_for_file(file_path, file_source_path)
|
46
|
-
file = PageWithoutAFile.new(@site,
|
48
|
+
file = PageWithoutAFile.new(@site, __dir__, "", file_path)
|
47
49
|
file.content = File.read(file_source_path).gsub(MINIFY_REGEX, "")
|
48
50
|
file.data["layout"] = nil
|
49
51
|
file.data["sitemap"] = false
|
data/lib/jekyll-feed/meta-tag.rb
CHANGED
data/script/cibuild
CHANGED
data/script/fmt
ADDED
data/script/test
ADDED
data/spec/jekyll-feed_spec.rb
CHANGED
@@ -104,6 +104,8 @@ describe(JekyllFeed) do
|
|
104
104
|
expect(feed.feed_type).to eql("atom")
|
105
105
|
expect(feed.feed_version).to eql("1.0")
|
106
106
|
expect(feed.encoding).to eql("UTF-8")
|
107
|
+
expect(feed.lang).to be_nil
|
108
|
+
expect(feed.valid?).to eql(true)
|
107
109
|
end
|
108
110
|
|
109
111
|
it "outputs the link" do
|
@@ -136,6 +138,31 @@ describe(JekyllFeed) do
|
|
136
138
|
expect(post.summary).to be_nil
|
137
139
|
end
|
138
140
|
|
141
|
+
context "with site.lang set" do
|
142
|
+
lang = "en_US"
|
143
|
+
let(:overrides) { {"lang" => lang} }
|
144
|
+
it "outputs a valid feed" do
|
145
|
+
expect(feed.feed_type).to eql("atom")
|
146
|
+
expect(feed.feed_version).to eql("1.0")
|
147
|
+
expect(feed.encoding).to eql("UTF-8")
|
148
|
+
expect(feed.valid?).to eql(true)
|
149
|
+
end
|
150
|
+
|
151
|
+
it "outputs the correct language" do
|
152
|
+
expect(feed.lang).to eql(lang)
|
153
|
+
end
|
154
|
+
|
155
|
+
it "sets the language of entries" do
|
156
|
+
post = feed.items.first
|
157
|
+
expect(post.lang).to eql(lang)
|
158
|
+
end
|
159
|
+
|
160
|
+
it "renders the feed meta" do
|
161
|
+
expected = %r!<link href="http://example.org/" rel="alternate" type="text/html" hreflang="#{lang}" />!
|
162
|
+
expect(contents).to match(expected)
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
139
166
|
context "with site.title set" do
|
140
167
|
let(:site_title) { "My Site Title" }
|
141
168
|
let(:overrides) { {"title" => site_title} }
|
data/spec/spec_helper.rb
CHANGED
@@ -2,7 +2,7 @@ require 'jekyll'
|
|
2
2
|
require 'typhoeus'
|
3
3
|
require 'nokogiri'
|
4
4
|
require 'rss'
|
5
|
-
require File.expand_path('../lib/jekyll-feed',
|
5
|
+
require File.expand_path('../lib/jekyll-feed', __dir__)
|
6
6
|
|
7
7
|
Jekyll.logger.log_level = :error
|
8
8
|
|
@@ -11,8 +11,8 @@ RSpec.configure do |config|
|
|
11
11
|
config.filter_run :focus
|
12
12
|
config.order = 'random'
|
13
13
|
|
14
|
-
SOURCE_DIR = File.expand_path("
|
15
|
-
DEST_DIR = File.expand_path("
|
14
|
+
SOURCE_DIR = File.expand_path("fixtures", __dir__)
|
15
|
+
DEST_DIR = File.expand_path("dest", __dir__)
|
16
16
|
|
17
17
|
def source_dir(*files)
|
18
18
|
File.join(SOURCE_DIR, *files)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-feed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Balter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -30,84 +30,84 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '1.
|
33
|
+
version: '1.15'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '1.
|
40
|
+
version: '1.15'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: nokogiri
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '1.6'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '1.6'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: rake
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '12.0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '12.0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: rspec
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '0
|
75
|
+
version: '3.0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0
|
82
|
+
version: '3.0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: rubocop
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - '='
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '0.51'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - '='
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
96
|
+
version: '0.51'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: typhoeus
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
103
|
+
version: '0.7'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - "
|
108
|
+
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
110
|
+
version: '0.7'
|
111
111
|
description:
|
112
112
|
email:
|
113
113
|
- ben.balter@github.com
|
@@ -130,9 +130,12 @@ files:
|
|
130
130
|
- lib/jekyll-feed/generator.rb
|
131
131
|
- lib/jekyll-feed/meta-tag.rb
|
132
132
|
- lib/jekyll-feed/page-without-a-file.rb
|
133
|
+
- lib/jekyll-feed/version.rb
|
133
134
|
- script/bootstrap
|
134
135
|
- script/cibuild
|
136
|
+
- script/fmt
|
135
137
|
- script/release
|
138
|
+
- script/test
|
136
139
|
- spec/fixtures/_config.yml
|
137
140
|
- spec/fixtures/_data/authors.yml
|
138
141
|
- spec/fixtures/_drafts/2015-01-12-a-draft.md
|
@@ -170,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
170
173
|
version: '0'
|
171
174
|
requirements: []
|
172
175
|
rubyforge_project:
|
173
|
-
rubygems_version: 2.
|
176
|
+
rubygems_version: 2.7.4
|
174
177
|
signing_key:
|
175
178
|
specification_version: 4
|
176
179
|
summary: A Jekyll plugin to generate an Atom feed of your Jekyll posts
|