jekyll-octopod 0.17.1 → 0.17.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: 241f37f4351eb2298f41b9b28476283589b7ce79ac82a70fe2926de580e43796
4
- data.tar.gz: f0a1fe92888438a64c9f340a1f8520f3a5158e90c45cc6be2150227935dd1843
3
+ metadata.gz: 9e84929423b130ee23b322dc8ce553a13d3eb2ceb7e45a857103f25e58412d37
4
+ data.tar.gz: 0475ba04a25d6eeca5e7acbc9867ca33f8faf55366ba220996031438eabceb9c
5
5
  SHA512:
6
- metadata.gz: d87e120cb798a302dc0a45e57eeaa574cdfec3eda5addb3a7ae01f3ca5272bfc8d31c9c9b3d09ecefa3da351498d5eedaf7f2ceb87b0badfdc3ed815d1d15bc5
7
- data.tar.gz: ae65359cd2e30620cd8d75edcbdb0d368f277a948c98d64ddc71df6bc39b1f21f1e13249688578dff3812a71f2a412c726d272758de56f70fede708c6b9108e5
6
+ metadata.gz: e2649960dd466f7d951d0633cf24ca34637c1d34de9ff6dfc6b530211f492b612cd3377bb54c87dd473f5d9e12ed7c2e35f4c5f371d9abfc9de1d1425848aec6
7
+ data.tar.gz: 1da3998eba6755e4363267240609a706f8bc8f26e54b39e04b05eb04475a18ddbf7283ac2d6b679b3a900498e89ed0eb0a77904044bd40e0952bb48fb0e456b2
@@ -3,10 +3,24 @@ module Jekyll
3
3
  safe true
4
4
 
5
5
  def generate(site)
6
- if site.layouts.key? 'player_index'
7
- dir = site.config['players_dir'] || 'players'
8
- site.posts.docs.each do |post|
9
- site.pages << PodcastPlayerPage.new(site, site.source, File.join(dir, post.data['slug']), post)
6
+ return unless site.layouts.key? 'player_index'
7
+
8
+ dir = site.config['players_dir'] || 'players'
9
+
10
+ # post.data['slug'] is derived from the filename's title portion only (no date), so two
11
+ # posts can legitimately share one - e.g. a recurring "Update" or "Q&A" episode, or (as
12
+ # found on panoptikum.io) two differently-titled posts that happen to share a filename
13
+ # word. Without disambiguation, both would resolve to the same players/<slug>/ page and
14
+ # one would silently vanish - whichever Jekyll generates second overwrites the first with
15
+ # no warning from this generator itself (Jekyll does warn about the resulting destination
16
+ # conflict, but only after the fact). The earliest post keeps the plain slug path so
17
+ # existing links for the common (non-colliding) case never change; later posts sharing
18
+ # that slug get their date appended instead of being dropped.
19
+ site.posts.docs.group_by { |post| post.data['slug'] }.each_value do |posts_with_slug|
20
+ posts_with_slug.sort_by(&:date).each_with_index do |post, index|
21
+ slug = post.data['slug']
22
+ page_dir = index.zero? ? slug : "#{slug}-#{post.date.strftime('%Y%m%d')}"
23
+ site.pages << PodcastPlayerPage.new(site, site.source, File.join(dir, page_dir), post)
10
24
  end
11
25
  end
12
26
  end
@@ -3,7 +3,7 @@ module Jekyll
3
3
  module VERSION #:nodoc:
4
4
  MAJOR = 0
5
5
  MINOR = 17
6
- TINY = 1
6
+ TINY = 2
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY].join('.')
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jekyll-octopod
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.1
4
+ version: 0.17.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arne Eilermann