bridgetown-feed 3.1.2 → 4.0.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c2cbc81ee48ebc1f53e334674cb20530d56b247fc6a72b1a577b8ee05fae1bd
4
- data.tar.gz: 62074e18bdbd7f012106610fd4aff9b1b2ac2498124e5523639b1c98d62492bc
3
+ metadata.gz: 6aef48adad606b4af2f1540e3e151126d893d18158a42b494a78d0133a306aa6
4
+ data.tar.gz: 879e376744ef6e3817a5b002a556f47e8551339e310c284414b6090f7b8bcedc
5
5
  SHA512:
6
- metadata.gz: ed5633b188945f86097644e563bcd5d3717cde120fab1774af50cc051ab4074ab761a43c41f95239878147155b6fa3bb5ac31ec948885dcddfc581ae1b01ef62
7
- data.tar.gz: 26df2d8ce71c4cc050d221f00b76cc4dfb1eb922268ec88929d6eb5cf221ac4656859aedb36333fb15ccef148e3b20d5c8e07c4b1ac1e9da80cc5c3e13b4130d
6
+ metadata.gz: 6bd43cb67df4e920ada7b7ded0454c0db9090147efc97ff87bc82ec29909c30c6cb3f9f4e806fb2506e43a3e05498dd2a36b4eb50e4b3ef5f4dfb277bbffdc2e
7
+ data.tar.gz: fbfc02b12d72663bbcd2c0df4c12a9f94d9d3010e9cbff55c7c1ba9d6a6cc4bb0d939029e54988ba47fe97f54e772c76945cf1e18148f8bff9332141103d2579
data/CHANGELOG.md CHANGED
@@ -4,6 +4,11 @@
4
4
 
5
5
  ...
6
6
 
7
+ ## 4.0.0 / 2025-09-16
8
+
9
+ * Enable use with Bridgetown 2.0 (@michaelherold)
10
+ * Add option to specify the feeds icon and logo (@jbennett)
11
+
7
12
  ## 3.1.2 / 2024-03-02
8
13
 
9
14
  * Fix: as readme promises, use `id` from a post's front matter if present
data/Gemfile CHANGED
@@ -3,4 +3,4 @@
3
3
  source "https://rubygems.org"
4
4
  gemspec
5
5
 
6
- gem "bridgetown", ENV["BRIDGETOWN_VERSION"] if ENV["BRIDGETOWN_VERSION"]
6
+ gem "bridgetown", ENV.fetch("BRIDGETOWN_VERSION", "2.0.0.beta6")
data/README.md CHANGED
@@ -34,16 +34,16 @@ The plugin exposes a helper tag to expose the appropriate meta tags to support a
34
34
 
35
35
  Simply place `feed_meta` someplace in your layout's `<head>` section to output the necessary metadata.
36
36
 
37
- ```liquid
38
- <!-- layout.liquid -->
39
- {% feed_meta %}
40
- ```
41
-
42
37
  ```erb
43
38
  <!-- layout.erb -->
44
39
  <%= feed_meta %>
45
40
  ```
46
41
 
42
+ ```liquid
43
+ <!-- layout.liquid -->
44
+ {% feed_meta %}
45
+ ```
46
+
47
47
  The plugin will automatically generate an Atom feed at `/feed.xml`.
48
48
 
49
49
  ### Optional configuration options
@@ -234,6 +234,16 @@ feed:
234
234
  post_limit: 25
235
235
  ```
236
236
 
237
+ ## Icons
238
+
239
+ You can optionally specify feed's icon and logo relative paths:
240
+
241
+ ```yml
242
+ feed:
243
+ icon: "/images/icon.png"
244
+ logo: "/images/logo.png"
245
+ ```
246
+
237
247
  ## Testing
238
248
 
239
249
  * Run `bundle exec rspec` to run the test suite
@@ -15,9 +15,9 @@ Gem::Specification.new do |spec|
15
15
  spec.test_files = spec.files.grep(%r!^spec/!)
16
16
  spec.require_paths = ["lib"]
17
17
 
18
- spec.required_ruby_version = ">= 2.7.0"
18
+ spec.required_ruby_version = ">= 3.1.0"
19
19
 
20
- spec.add_dependency "bridgetown", ">= 1.2.0.beta2", "< 2.0"
20
+ spec.add_dependency "bridgetown", ">= 1.2.0"
21
21
 
22
22
  spec.add_development_dependency "bundler"
23
23
  spec.add_development_dependency "rss"
@@ -3,6 +3,7 @@
3
3
  module BridgetownFeed
4
4
  class Builder < Bridgetown::Builder
5
5
  include Bridgetown::Filters::URLFilters
6
+
6
7
  Context = Struct.new(:registers)
7
8
 
8
9
  def build
@@ -9,6 +9,13 @@
9
9
  <updated>{{ site.time | date_to_xmlschema }}</updated>
10
10
  <id>{{ page.url | absolute_url | xml_escape }}</id>
11
11
 
12
+ {% if site.feed.icon and site.feed.icon != empty %}
13
+ <icon>{{ site.feed.icon | absolute_url }}</icon>
14
+ {% endif %}
15
+ {% if site.feed.logo and site.feed.logo != empty %}
16
+ <logo>{{ site.feed.logo | absolute_url }}</logo>
17
+ {% endif %}
18
+
12
19
  {% assign title = site.metadata.title | default: site.metadata.name %}
13
20
  {% if page.collection != "posts" %}
14
21
  {% assign collection = page.collection | capitalize %}
@@ -2,6 +2,12 @@
2
2
 
3
3
  module BridgetownFeed
4
4
  class Generator < Bridgetown::Generator
5
+ # Matches all whitespace that follows
6
+ # 1. A '>', which closes an XML tag or
7
+ # 2. A '}', which closes a Liquid tag
8
+ # We will strip all of this whitespace to minify the template
9
+ MINIFY_REGEX = %r!(?<=>|})\s+!.freeze
10
+
5
11
  priority :lowest
6
12
 
7
13
  # Main plugin action, called by Bridgetown-core
@@ -20,12 +26,6 @@ module BridgetownFeed
20
26
 
21
27
  private
22
28
 
23
- # Matches all whitespace that follows
24
- # 1. A '>', which closes an XML tag or
25
- # 2. A '}', which closes a Liquid tag
26
- # We will strip all of this whitespace to minify the template
27
- MINIFY_REGEX = %r!(?<=>|})\s+!.freeze
28
-
29
29
  # Returns the plugin's config or an empty hash if not set
30
30
  def config
31
31
  @config ||= @site.config["feed"] || {}
@@ -70,7 +70,7 @@ module BridgetownFeed
70
70
 
71
71
  # Path to feed.xml template file
72
72
  def feed_source_path
73
- @feed_source_path ||= File.expand_path "feed.xml", __dir__
73
+ @feed_source_path ||= File.expand_path "feed.liquid", __dir__
74
74
  end
75
75
 
76
76
  def feed_template
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Bridgetown
4
4
  module Feed
5
- VERSION = "3.1.2"
5
+ VERSION = "4.0.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bridgetown-feed
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.2
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bridgetown Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-03 00:00:00.000000000 Z
11
+ date: 2025-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bridgetown
@@ -16,20 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 1.2.0.beta2
20
- - - "<"
21
- - !ruby/object:Gem::Version
22
- version: '2.0'
19
+ version: 1.2.0
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - ">="
28
25
  - !ruby/object:Gem::Version
29
- version: 1.2.0.beta2
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: '2.0'
26
+ version: 1.2.0
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: bundler
35
29
  requirement: !ruby/object:Gem::Requirement
@@ -151,7 +145,7 @@ files:
151
145
  - bridgetown-feed.gemspec
152
146
  - lib/bridgetown-feed.rb
153
147
  - lib/bridgetown-feed/builder.rb
154
- - lib/bridgetown-feed/feed.xml
148
+ - lib/bridgetown-feed/feed.liquid
155
149
  - lib/bridgetown-feed/generator.rb
156
150
  - lib/bridgetown-feed/version.rb
157
151
  homepage: https://github.com/bridgetownrb/bridgetown-feed
@@ -166,14 +160,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
166
160
  requirements:
167
161
  - - ">="
168
162
  - !ruby/object:Gem::Version
169
- version: 2.7.0
163
+ version: 3.1.0
170
164
  required_rubygems_version: !ruby/object:Gem::Requirement
171
165
  requirements:
172
166
  - - ">="
173
167
  - !ruby/object:Gem::Version
174
168
  version: '0'
175
169
  requirements: []
176
- rubygems_version: 3.5.3
170
+ rubygems_version: 3.5.16
177
171
  signing_key:
178
172
  specification_version: 4
179
173
  summary: A Bridgetown plugin to generate an Atom feed of your Bridgetown posts