bridgetown-feed 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +21 -0
  3. data/.rspec +2 -0
  4. data/.rubocop.yml +27 -0
  5. data/Gemfile +11 -0
  6. data/History.markdown +5 -0
  7. data/LICENSE.txt +23 -0
  8. data/README.md +201 -0
  9. data/Rakefile +8 -0
  10. data/bridgetown-feed.gemspec +28 -0
  11. data/lib/bridgetown-feed.rb +12 -0
  12. data/lib/bridgetown-feed/feed.xml +96 -0
  13. data/lib/bridgetown-feed/generator.rb +111 -0
  14. data/lib/bridgetown-feed/meta-tag.rb +37 -0
  15. data/lib/bridgetown-feed/page-without-a-file.rb +9 -0
  16. data/lib/bridgetown-feed/version.rb +7 -0
  17. data/script/bootstrap +3 -0
  18. data/script/cibuild +7 -0
  19. data/script/fmt +10 -0
  20. data/script/release +7 -0
  21. data/script/test +4 -0
  22. data/spec/bridgetown-feed_spec.rb +525 -0
  23. data/spec/fixtures/bridgetown.config.yml +9 -0
  24. data/spec/fixtures/src/_collection/2018-01-01-collection-doc.md +4 -0
  25. data/spec/fixtures/src/_collection/2018-01-02-collection-category-doc.md +5 -0
  26. data/spec/fixtures/src/_data/authors.yml +5 -0
  27. data/spec/fixtures/src/_layouts/some_default.html +11 -0
  28. data/spec/fixtures/src/_posts/2013-12-12-dec-the-second.md +7 -0
  29. data/spec/fixtures/src/_posts/2014-03-02-march-the-second.md +6 -0
  30. data/spec/fixtures/src/_posts/2014-03-04-march-the-fourth.md +9 -0
  31. data/spec/fixtures/src/_posts/2015-01-12-a-draft.md +5 -0
  32. data/spec/fixtures/src/_posts/2015-01-18-jekyll-last-modified-at.md +5 -0
  33. data/spec/fixtures/src/_posts/2015-02-12-strip-newlines.md +6 -0
  34. data/spec/fixtures/src/_posts/2015-05-12-liquid.md +7 -0
  35. data/spec/fixtures/src/_posts/2015-05-12-pre.html +8 -0
  36. data/spec/fixtures/src/_posts/2015-05-18-author-detail.md +9 -0
  37. data/spec/fixtures/src/_posts/2015-08-08-stuck-in-the-middle.html +6 -0
  38. data/spec/fixtures/src/_posts/2016-04-25-author-reference.md +6 -0
  39. data/spec/fixtures/src/feed.xslt.xml +0 -0
  40. data/spec/spec_helper.rb +35 -0
  41. metadata +210 -0
@@ -0,0 +1,9 @@
1
+ timezone: UTC
2
+
3
+ defaults:
4
+ -
5
+ scope:
6
+ path: ""
7
+ type: pages
8
+ values:
9
+ layout: some_default
@@ -0,0 +1,4 @@
1
+ ---
2
+ ---
3
+
4
+ Look at me! I'm a collection!
@@ -0,0 +1,5 @@
1
+ ---
2
+ category: news
3
+ ---
4
+
5
+ Look at me! I'm a collection doc in a category!
@@ -0,0 +1,5 @@
1
+ garthdb:
2
+ name: Garth
3
+ twitter: garthdb
4
+ uri: "http://garthdb.com"
5
+ email: example@mail.com
@@ -0,0 +1,11 @@
1
+ ---
2
+ ---
3
+ <html>
4
+ <head>
5
+ {% feed_meta %}
6
+ </head>
7
+ <body>
8
+ THIS IS MY LAYOUT
9
+ {{ content }}
10
+ </body>
11
+ </html>
@@ -0,0 +1,7 @@
1
+ ---
2
+ excerpt: "Foo"
3
+ image: "/image.png"
4
+ category: news
5
+ ---
6
+
7
+ # December the twelfth, actually.
@@ -0,0 +1,6 @@
1
+ ---
2
+ image: https://cdn.example.org/absolute.png?h=188&w=250
3
+ category: news
4
+ ---
5
+
6
+ March the second!
@@ -0,0 +1,9 @@
1
+ ---
2
+ tags:
3
+ - '"/><VADER>'
4
+ image:
5
+ path: "/object-image.png"
6
+ categories: updates bridgetown
7
+ ---
8
+
9
+ March the fourth!
@@ -0,0 +1,5 @@
1
+ ---
2
+ published: false
3
+ ---
4
+
5
+ This is a draft.
@@ -0,0 +1,5 @@
1
+ ---
2
+ last_modified_at: 2015-05-12T13:27:59+00:00
3
+ ---
4
+
5
+ Please don't modify this file. It's modified time is important.
@@ -0,0 +1,6 @@
1
+ ---
2
+ title:
3
+ The plugin
4
+ will properly
5
+ strip newlines.
6
+ ---
@@ -0,0 +1,7 @@
1
+ ---
2
+ ---
3
+
4
+ {% capture liquidstring %}
5
+ Liquid is not rendered.
6
+ {% endcapture %}
7
+ {{ liquidstring | replace:'not ','' }}
@@ -0,0 +1,8 @@
1
+ ---
2
+ author: Pat
3
+ lang: en
4
+ ---
5
+
6
+ <pre>Line 1
7
+ Line 2
8
+ Line 3</pre>
@@ -0,0 +1,9 @@
1
+ ---
2
+ excerpt: ""
3
+ author:
4
+ name: Ben
5
+ uri: "http://ben.balter.com"
6
+ email: ben@example.com
7
+ ---
8
+
9
+ # December the twelfth, actually.
@@ -0,0 +1,6 @@
1
+ ---
2
+ feed:
3
+ excerpt_only: true
4
+ ---
5
+
6
+ This content should not be in feed.
@@ -0,0 +1,6 @@
1
+ ---
2
+ excerpt: ""
3
+ author: garthdb
4
+ ---
5
+
6
+ # April the twenty-fifth?
File without changes
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bridgetown"
4
+ require "typhoeus" unless Gem.win_platform?
5
+ require "nokogiri"
6
+ require "rss"
7
+ require File.expand_path("../lib/bridgetown-feed", __dir__)
8
+
9
+ Bridgetown.logger.log_level = :error
10
+
11
+ RSpec.configure do |config|
12
+ config.run_all_when_everything_filtered = true
13
+ config.filter_run :focus
14
+ config.order = "random"
15
+
16
+ ROOT_DIR = File.expand_path("fixtures", __dir__)
17
+ SOURCE_DIR = File.join(ROOT_DIR, "src")
18
+ DEST_DIR = File.expand_path("dest", __dir__)
19
+
20
+ def root_dir(*files)
21
+ File.join(ROOT_DIR, *files)
22
+ end
23
+
24
+ def source_dir(*files)
25
+ File.join(SOURCE_DIR, *files)
26
+ end
27
+
28
+ def dest_dir(*files)
29
+ File.join(DEST_DIR, *files)
30
+ end
31
+
32
+ def make_context(registers = {})
33
+ Liquid::Context.new({}, {}, { :site => site }.merge(registers))
34
+ end
35
+ end
metadata ADDED
@@ -0,0 +1,210 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bridgetown-feed
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Bridgetown Team
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2020-04-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bridgetown
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0.6'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '2.0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '0.6'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '2.0'
33
+ - !ruby/object:Gem::Dependency
34
+ name: bundler
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: nokogiri
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '1.6'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '1.6'
61
+ - !ruby/object:Gem::Dependency
62
+ name: rake
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '12.0'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '12.0'
75
+ - !ruby/object:Gem::Dependency
76
+ name: rspec
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '3.0'
82
+ type: :development
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: '3.0'
89
+ - !ruby/object:Gem::Dependency
90
+ name: rubocop-jekyll
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '0.5'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: '0.5'
103
+ - !ruby/object:Gem::Dependency
104
+ name: typhoeus
105
+ requirement: !ruby/object:Gem::Requirement
106
+ requirements:
107
+ - - ">="
108
+ - !ruby/object:Gem::Version
109
+ version: '0.7'
110
+ - - "<"
111
+ - !ruby/object:Gem::Version
112
+ version: '2.0'
113
+ type: :development
114
+ prerelease: false
115
+ version_requirements: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ version: '0.7'
120
+ - - "<"
121
+ - !ruby/object:Gem::Version
122
+ version: '2.0'
123
+ description:
124
+ email: maintainers@bridgetownrb.com
125
+ executables: []
126
+ extensions: []
127
+ extra_rdoc_files: []
128
+ files:
129
+ - ".gitignore"
130
+ - ".rspec"
131
+ - ".rubocop.yml"
132
+ - Gemfile
133
+ - History.markdown
134
+ - LICENSE.txt
135
+ - README.md
136
+ - Rakefile
137
+ - bridgetown-feed.gemspec
138
+ - lib/bridgetown-feed.rb
139
+ - lib/bridgetown-feed/feed.xml
140
+ - lib/bridgetown-feed/generator.rb
141
+ - lib/bridgetown-feed/meta-tag.rb
142
+ - lib/bridgetown-feed/page-without-a-file.rb
143
+ - lib/bridgetown-feed/version.rb
144
+ - script/bootstrap
145
+ - script/cibuild
146
+ - script/fmt
147
+ - script/release
148
+ - script/test
149
+ - spec/bridgetown-feed_spec.rb
150
+ - spec/fixtures/bridgetown.config.yml
151
+ - spec/fixtures/src/_collection/2018-01-01-collection-doc.md
152
+ - spec/fixtures/src/_collection/2018-01-02-collection-category-doc.md
153
+ - spec/fixtures/src/_data/authors.yml
154
+ - spec/fixtures/src/_layouts/some_default.html
155
+ - spec/fixtures/src/_posts/2013-12-12-dec-the-second.md
156
+ - spec/fixtures/src/_posts/2014-03-02-march-the-second.md
157
+ - spec/fixtures/src/_posts/2014-03-04-march-the-fourth.md
158
+ - spec/fixtures/src/_posts/2015-01-12-a-draft.md
159
+ - spec/fixtures/src/_posts/2015-01-18-jekyll-last-modified-at.md
160
+ - spec/fixtures/src/_posts/2015-02-12-strip-newlines.md
161
+ - spec/fixtures/src/_posts/2015-05-12-liquid.md
162
+ - spec/fixtures/src/_posts/2015-05-12-pre.html
163
+ - spec/fixtures/src/_posts/2015-05-18-author-detail.md
164
+ - spec/fixtures/src/_posts/2015-08-08-stuck-in-the-middle.html
165
+ - spec/fixtures/src/_posts/2016-04-25-author-reference.md
166
+ - spec/fixtures/src/feed.xslt.xml
167
+ - spec/spec_helper.rb
168
+ homepage: https://github.com/bridgetownrb/bridgetown-feed
169
+ licenses:
170
+ - MIT
171
+ metadata: {}
172
+ post_install_message:
173
+ rdoc_options: []
174
+ require_paths:
175
+ - lib
176
+ required_ruby_version: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: 2.4.0
181
+ required_rubygems_version: !ruby/object:Gem::Requirement
182
+ requirements:
183
+ - - ">="
184
+ - !ruby/object:Gem::Version
185
+ version: '0'
186
+ requirements: []
187
+ rubygems_version: 3.0.6
188
+ signing_key:
189
+ specification_version: 4
190
+ summary: A Bridgetown plugin to generate an Atom feed of your Bridgetown posts
191
+ test_files:
192
+ - spec/bridgetown-feed_spec.rb
193
+ - spec/fixtures/bridgetown.config.yml
194
+ - spec/fixtures/src/_collection/2018-01-01-collection-doc.md
195
+ - spec/fixtures/src/_collection/2018-01-02-collection-category-doc.md
196
+ - spec/fixtures/src/_data/authors.yml
197
+ - spec/fixtures/src/_layouts/some_default.html
198
+ - spec/fixtures/src/_posts/2013-12-12-dec-the-second.md
199
+ - spec/fixtures/src/_posts/2014-03-02-march-the-second.md
200
+ - spec/fixtures/src/_posts/2014-03-04-march-the-fourth.md
201
+ - spec/fixtures/src/_posts/2015-01-12-a-draft.md
202
+ - spec/fixtures/src/_posts/2015-01-18-jekyll-last-modified-at.md
203
+ - spec/fixtures/src/_posts/2015-02-12-strip-newlines.md
204
+ - spec/fixtures/src/_posts/2015-05-12-liquid.md
205
+ - spec/fixtures/src/_posts/2015-05-12-pre.html
206
+ - spec/fixtures/src/_posts/2015-05-18-author-detail.md
207
+ - spec/fixtures/src/_posts/2015-08-08-stuck-in-the-middle.html
208
+ - spec/fixtures/src/_posts/2016-04-25-author-reference.md
209
+ - spec/fixtures/src/feed.xslt.xml
210
+ - spec/spec_helper.rb