jekyll-feed 0.7.2 → 0.8.0

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: 29260f36998522e4c79581e9db32ab1da5beacbe
4
- data.tar.gz: 8f471054cec8cadb271288e79b84e90604ab667a
3
+ metadata.gz: 31ec255441efdec76e24a57228ad15d4df8792aa
4
+ data.tar.gz: 771f380686b7c6b1f988924ad385abc7e45c044a
5
5
  SHA512:
6
- metadata.gz: bd31985f2ffb8f3d10de9025ebd3a333b4d9bb4344953f633fe0fc94d458e2130b3a7c758f6c206a37075b1d2884f6a21c60bd59781359c542856936dd9e88c4
7
- data.tar.gz: 6f4ca44cab5047f5910c0e2b2b6c0c14baa7c8484d734d9b349ad2cd033a5fc6368005187000590a822654ba247f547dbef0d2199e77b4c4e794475f785f74cb
6
+ metadata.gz: 4f380d4240ccedfe0d193b5ec88cf10feabae1bd948c982340fc078b1fb3653784c3be9188d42923978a67dc13d3be086d306fc324101cdc610dcd36530c664a
7
+ data.tar.gz: 85c8856882d47079feb5cedbb44975d077c48a6291e6ae181fc924952292fd02b8c1b09d60d3a561cb2b59cbafe281ea5a254b1be71864b2904b7b90cd8fef50
@@ -2,7 +2,7 @@ inherit_gem:
2
2
  jekyll: .rubocop.yml
3
3
 
4
4
  AllCops:
5
- TargetRubyVersion: 1.9
5
+ TargetRubyVersion: 2.0
6
6
  Include:
7
7
  - lib/*.rb
8
8
 
@@ -1,3 +1,15 @@
1
+ ## 0.8.0 / 2016-10-06
2
+
3
+ * Use filters to clean up Liquid template (#134)
4
+
5
+ ### Minor Enhancements
6
+
7
+ * Don't set @site.config["time"] on feed generation (#138)
8
+
9
+ ### pedantry
10
+
11
+ * Appease Rubocop (#139)
12
+
1
13
  ## 0.7.2 / 2016-10-06
2
14
 
3
15
  * Support `image.path` when `post.image` is an object (#137)
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "jekyll-feed"
5
- spec.version = "0.7.2"
5
+ spec.version = "0.8.0"
6
6
  spec.authors = ["Ben Balter"]
7
7
  spec.email = ["ben.balter@github.com"]
8
8
  spec.summary = "A Jekyll plugin to generate an Atom feed of your Jekyll posts"
@@ -14,7 +14,8 @@ Gem::Specification.new do |spec|
14
14
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
15
15
  spec.require_paths = ["lib"]
16
16
 
17
- spec.add_development_dependency "jekyll", ">= 3.1.0", "< 3.2.0"
17
+ spec.add_dependency "jekyll", "~> 3.3"
18
+
18
19
  spec.add_development_dependency "bundler", "~> 1.6"
19
20
  spec.add_development_dependency "rake", "~> 10.0"
20
21
  spec.add_development_dependency "rspec", "~> 3.0"
@@ -1,16 +1,11 @@
1
1
  <?xml version="1.0" encoding="utf-8"?>
2
- {% if site.url %}
3
- {% assign url_base = site.url | append: site.baseurl %}
4
- {% else %}
5
- {% assign url_base = site.github.url %}
6
- {% endif %}
7
- <?xml-stylesheet type="text/xml" href="{{ url_base }}/feed.xslt.xml"?>
2
+ <?xml-stylesheet type="text/xml" href="{{ '/feed.xslt.xml' | absolute_url }}"?>
8
3
  <feed xmlns="http://www.w3.org/2005/Atom"{% if site.lang %} xml:lang="{{ site.lang }}"{% endif %}>
9
4
  <generator uri="http://jekyllrb.com" version="{{ jekyll.version }}">Jekyll</generator>
10
- <link href="{{ page.url | prepend: url_base }}" rel="self" type="application/atom+xml" />
11
- <link href="{{ url_base }}/" rel="alternate" type="text/html" {% if site.lang %}hreflang="{{ site.lang }}" {% endif %}/>
5
+ <link href="{{ page.url | absolute_url }}" rel="self" type="application/atom+xml" />
6
+ <link href="{{ '/' | absolute_url }}" rel="alternate" type="text/html" {% if site.lang %}hreflang="{{ site.lang }}" {% endif %}/>
12
7
  <updated>{{ site.time | date_to_xmlschema }}</updated>
13
- <id>{{ url_base | xml_escape }}/</id>
8
+ <id>{{ '/' | absolute_url | xml_escape }}/</id>
14
9
 
15
10
  {% if site.title %}
16
11
  <title type="html">{{ site.title | smartify | xml_escape }}</title>
@@ -24,11 +19,7 @@
24
19
 
25
20
  {% if site.author %}
26
21
  <author>
27
- {% if site.author.name %}
28
- <name>{{ site.author.name | xml_escape }}</name>
29
- {% else %}
30
- <name>{{ site.author | xml_escape }}</name>
31
- {% endif %}
22
+ <name>{{ site.author.name | default: site.author | xml_escape }}</name>
32
23
  {% if site.author.email %}
33
24
  <email>{{ site.author.email | xml_escape }}</email>
34
25
  {% endif %}
@@ -42,16 +33,11 @@
42
33
  {% unless post.draft %}
43
34
  <entry{% if post.lang %} xml:lang="{{ post.lang }}"{% endif %}>
44
35
  <title type="html">{{ post.title | smartify | strip_html | replace: '\n', ' ' | strip | xml_escape }}</title>
45
- <link href="{{ post.url | prepend: url_base }}" rel="alternate" type="text/html" title="{{ post.title | xml_escape }}" />
36
+ <link href="{{ post.url | absolute_url }}" rel="alternate" type="text/html" title="{{ post.title | xml_escape }}" />
46
37
  <published>{{ post.date | date_to_xmlschema }}</published>
47
- {% if post.last_modified_at %}
48
- <updated>{{ post.last_modified_at | date_to_xmlschema }}</updated>
49
- {% else %}
50
- <updated>{{ post.date | date_to_xmlschema }}</updated>
51
- {% endif %}
52
-
53
- <id>{{ post.id | prepend: url_base | xml_escape }}</id>
54
- <content type="html" xml:base="{{ post.url | prepend: url_base | xml_escape }}">{{ post.content | strip | xml_escape }}</content>
38
+ <updated>{{ post.last_modified_at | default: post.date | date_to_xmlschema }}</updated>
39
+ <id>{{ post.id | absolute_url | xml_escape }}</id>
40
+ <content type="html" xml:base="{{ post.url | absolute_url | xml_escape }}">{{ post.content | strip | xml_escape }}</content>
55
41
 
56
42
  {% assign post_author = post.author | default: post.authors[0] | default: site.author %}
57
43
  {% assign post_author = site.data.authors[post_author] | default: post_author %}
@@ -86,7 +72,7 @@
86
72
  {% assign post_image = post.image.path | default: post.image %}
87
73
  {% if post_image %}
88
74
  {% unless post_image contains "://" %}
89
- {% assign post_image = post_image | prepend: url_base | xml_escape %}
75
+ {% assign post_image = post_image | absolute_url | xml_escape %}
90
76
  {% endunless %}
91
77
  <media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="{{ post_image }}" />
92
78
  {% endif %}
@@ -1,4 +1,3 @@
1
1
  require "jekyll/feed_meta_tag"
2
2
  require "jekyll/jekyll-feed"
3
3
  require "jekyll/page_without_a_file"
4
- require "jekyll/strip_whitespace"
@@ -2,7 +2,7 @@ module Jekyll
2
2
  class FeedMetaTag < Liquid::Tag
3
3
  def render(context)
4
4
  @context = context
5
- attrs = attributes.map { |k, v| %(#{k}="#{v}") }.join(' ')
5
+ attrs = attributes.map { |k, v| %(#{k}="#{v}") }.join(" ")
6
6
  "<link #{attrs} />"
7
7
  end
8
8
 
@@ -14,9 +14,9 @@ module Jekyll
14
14
 
15
15
  def attributes
16
16
  {
17
- :type => 'application/atom+xml',
18
- :rel => 'alternate',
19
- :href => "#{url}/#{path}",
17
+ :type => "application/atom+xml",
18
+ :rel => "alternate",
19
+ :href => "#{url}/#{path}",
20
20
  :title => title
21
21
  }.keep_if { |_, v| v }
22
22
  end
@@ -8,7 +8,6 @@ module Jekyll
8
8
  # Main plugin action, called by Jekyll-core
9
9
  def generate(site)
10
10
  @site = site
11
- @site.config["time"] = Time.new
12
11
  unless file_exists?(feed_path)
13
12
  @site.pages << content_for_file(feed_path, feed_source_path)
14
13
  end
@@ -55,7 +54,7 @@ module Jekyll
55
54
  # Generates contents for a file
56
55
  def content_for_file(file_path, file_source_path)
57
56
  file = PageWithoutAFile.new(@site, File.dirname(__FILE__), "", file_path)
58
- file.content = File.read(file_source_path).gsub(/(?<!\")\s+([<{])/, '\1')
57
+ file.content = File.read(file_source_path).gsub(%r!(?<\!")\s+([<{])!, '\1')
59
58
  file.data["layout"] = nil
60
59
  file.data["sitemap"] = false
61
60
  file.output
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-feed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Balter
@@ -14,22 +14,16 @@ dependencies:
14
14
  name: jekyll
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: 3.1.0
20
- - - "<"
17
+ - - "~>"
21
18
  - !ruby/object:Gem::Version
22
- version: 3.2.0
23
- type: :development
19
+ version: '3.3'
20
+ type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- version: 3.1.0
30
- - - "<"
24
+ - - "~>"
31
25
  - !ruby/object:Gem::Version
32
- version: 3.2.0
26
+ version: '3.3'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: bundler
35
29
  requirement: !ruby/object:Gem::Requirement
@@ -137,7 +131,6 @@ files:
137
131
  - lib/jekyll/feed_meta_tag.rb
138
132
  - lib/jekyll/jekyll-feed.rb
139
133
  - lib/jekyll/page_without_a_file.rb
140
- - lib/jekyll/strip_whitespace.rb
141
134
  - script/bootstrap
142
135
  - script/cibuild
143
136
  - script/release
@@ -1,15 +0,0 @@
1
- # The `strip` filter was added to Liquid in version 3
2
- # Jekyll did not require Liquid 3 until Jekyll 3.0.0
3
- # This shim is needed for compatibility with Jekyll 2.x
4
-
5
- module Jekyll
6
- module StripWhitespace
7
- def strip(input)
8
- input.to_s.strip
9
- end
10
- end
11
- end
12
-
13
- unless Liquid::StandardFilters.method_defined?(:strip)
14
- Liquid::Template.register_filter(Jekyll::StripWhitespace)
15
- end