nanoc-feeds 0.1.1 → 0.1.2

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: f33569d2b8cbe63ae3e74aaef6861d55dbfd1f4b3c080be59acc86ba48a738a3
4
- data.tar.gz: 46ef59228bdeba72b9c3230041a8714e5e075991f9ade4d790e2e9cc2cd2d1e5
3
+ metadata.gz: f40b9f32b3ed641d3930ef1a5a6dc1020a8cda66c66176cea5497a47058a369c
4
+ data.tar.gz: 13bdb8b0b8497e288639650857a2f8f0df7a17e3053497ee153ff88a1c1c2424
5
5
  SHA512:
6
- metadata.gz: 2502f3040990e5209c424849f1e8c9360c5c576dbf6b3c8db23cc2a279723986c58764a37db84728169addb5448ca472873639993f698679b66ed00374a845a6
7
- data.tar.gz: 36fd5bf1d94df274e88bc53ca5a472b3e60d039ff04efa08ee3c37d342fc6eb7527957b4ccb55b14a8403fa35c2e20c740aabadd073b314180c4863a2a962f23
6
+ metadata.gz: cb5f63cb408efe141e29af0b478ad02b387457e476372b9bf7ff51af3fb7b4aac2cd88f2ae732d82102dda2df0499d1b610a8381b05955389642e08f3789276e
7
+ data.tar.gz: 98b33920ee6695e209f2bcd4aa4df775a662d5bc2944aa55bbf3eee5b6fe0873505334a4e9d3ad7c3fc492d046711bf2da334856751b99daaa91ed44a558d14a
data/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # Nanoc::Feeds
2
2
 
3
- A set of helpers for generating additional feeds in nanoc. Currenntly JSON and Atom feeds are supported.
3
+ A set of helpers for generating additional feeds in nanoc. Currently JSON and Atom feeds are supported.
4
4
 
5
5
  ## Installation
6
6
 
7
- Install the gem and add to the application's Gemfile by executing:
7
+ Install the gem and add to your nanoc project Gemfile by executing:
8
8
 
9
9
  ```bash
10
10
  bundle add nanoc-feeds
@@ -14,13 +14,17 @@ module Nanoc::Feeds::Helpers::Feeds
14
14
 
15
15
  def json_feed(params = {})
16
16
  articles = params[:articles]
17
+ articles = articles.first(params[:limit]) if params[:limit]
17
18
  title = params[:title] || @config[:title]
19
+
20
+ items = articles.map { |article| build_for_article(article, title) }
21
+
18
22
  {
19
23
  version: "https://jsonfeed.org/version/1.1",
20
24
  title: title,
21
25
  home_page_url: "#{config[:base_url]}",
22
- feed_url: "#{config[:base_url]}/feed.json",
23
- items: articles.map { |article| build_for_article(article, title) }
26
+ feed_url: feed_url,
27
+ items: items
24
28
  }.to_json
25
29
  end
26
30
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Nanoc
4
4
  module Feeds
5
- VERSION = "0.1.1"
5
+ VERSION = "0.1.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nanoc-feeds
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Emhofer
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-01-19 00:00:00.000000000 Z
10
+ date: 2025-01-20 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: zeitwerk