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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: fff077f51b1b4b3b1e983bf5c211944916274d26
4
- data.tar.gz: f260cd7fbca8361948de81c0724147a846843d8f
2
+ SHA256:
3
+ metadata.gz: fc06c19cf7a822a53cc32bbf9cce036aeca5bf709a111830442897033811850d
4
+ data.tar.gz: c4729a2bfe3abb4490f32dcc04c6080259d3189c060f35af06242f5fa995ef7b
5
5
  SHA512:
6
- metadata.gz: 44ba9ce96ae0d11b7fe7d65c15100d2bb0eab713c9f0a0d6519068771ba063d733078870445000eb80700e68bf9cd0b4ee1cb01f0d6fd11417914a0555c9d686
7
- data.tar.gz: '0491a6e21f94f30906678bde1449c8a63a961499c78f01311555687eebd25f1232c494e0500c71ac51c0d848e6d7c8d259efb7feb22af9fce80c15863138ab78'
6
+ metadata.gz: 844acc55c1bc3d14bc9fe1f061acc6ed8be1f425dcb86eaa1a51de6ccbb590f4424a77203a0f6faf6791f9a6302fbcbd213f297768835fa6ae4323a873feb63b
7
+ data.tar.gz: 944201044de4e0efdcc0ac5fe5a8cb122a15f72c2b3526e757ce1f1a15c8771676978e506a1d7d2d1792a748ef73340c2602e41fdeef9f3f371cff7dbe485e91
@@ -2,7 +2,7 @@ inherit_gem:
2
2
  jekyll: .rubocop.yml
3
3
 
4
4
  AllCops:
5
- TargetRubyVersion: 2.0
5
+ TargetRubyVersion: 2.3
6
6
  Include:
7
7
  - lib/*.rb
8
8
 
@@ -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
- cache: bundler
8
- sudo: false
12
+ before_install:
13
+ - gem update --system
9
14
  before_script: bundle update
10
- script: "./script/cibuild"
15
+ script: script/cibuild
11
16
  notifications:
12
17
  email: false
13
18
  deploy:
data/Gemfile CHANGED
@@ -1,4 +1,6 @@
1
- source 'https://rubygems.org'
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
2
4
  gemspec
3
5
 
4
6
  if ENV["JEKYLL_VERSION"]
@@ -1,13 +1,29 @@
1
- ## HEAD
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
- * Use `https` in more places. (#165)
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
@@ -1,4 +1,4 @@
1
- Copyright (c) 2015 Ben Balter
1
+ Copyright (c) 2015-present Ben Balter and jekyll-feed contributors
2
2
 
3
3
  MIT License
4
4
 
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
- gems:
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
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "bundler/gem_tasks"
2
- require 'rspec/core/rake_task'
4
+ require "rspec/core/rake_task"
3
5
 
4
6
  RSpec::Core::RakeTask.new(:spec)
5
7
 
@@ -1,8 +1,12 @@
1
- # coding: utf-8
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 = "0.9.2"
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{^bin/}) { |f| File.basename(f) }
14
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
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.6"
20
- spec.add_development_dependency "rake", "~> 10.0"
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
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "jekyll"
2
4
  require "fileutils"
3
5
  require "jekyll-feed/generator"
@@ -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 "./feed.xml", File.dirname(__FILE__)
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, File.dirname(__FILE__), "", file_path)
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
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module JekyllFeed
2
4
  class MetaTag < Liquid::Tag
3
5
  # Use Jekyll's native relative_url filter
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module JekyllFeed
2
4
  class PageWithoutAFile < Jekyll::Page
3
5
  def read_yaml(*)
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Jekyll
4
+ module Feed
5
+ VERSION = "0.9.3"
6
+ end
7
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  set -e
4
4
 
5
- bundle exec rspec
6
- bundle exec rubocop -S -D
5
+ script/test
6
+ script/fmt
7
7
  bundle exec rake build
@@ -0,0 +1,10 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ echo "Rubocop $(bundle exec rubocop --version)"
5
+ bundle exec rubocop -D -E $@
6
+ success=$?
7
+ if ((success != 0)); then
8
+ echo -e "\nTry running \`script/fmt -a\` to automatically fix errors"
9
+ fi
10
+ exit $success
@@ -0,0 +1,4 @@
1
+ #!/bin/bash
2
+ set -ex
3
+
4
+ bundle exec rspec "$@"
@@ -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} }
@@ -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', File.dirname(__FILE__))
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("../fixtures", __FILE__)
15
- DEST_DIR = File.expand_path("../dest", __FILE__)
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.2
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: 2017-03-28 00:00:00.000000000 Z
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.6'
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.6'
40
+ version: '1.15'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rake
42
+ name: nokogiri
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '10.0'
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: '10.0'
54
+ version: '1.6'
55
55
  - !ruby/object:Gem::Dependency
56
- name: rspec
56
+ name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '3.0'
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: '3.0'
68
+ version: '12.0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: typhoeus
70
+ name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0.7'
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.7'
82
+ version: '3.0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: nokogiri
84
+ name: rubocop
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: '1.6'
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: '1.6'
96
+ version: '0.51'
97
97
  - !ruby/object:Gem::Dependency
98
- name: rubocop
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.6.11
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