jekyll-octopod 0.17.0 → 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 +4 -4
- data/lib/jekyll/line_awesome.rb +18 -3
- data/lib/jekyll/podcast_player_page_generator.rb +18 -4
- data/lib/octopod/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9e84929423b130ee23b322dc8ce553a13d3eb2ceb7e45a857103f25e58412d37
|
|
4
|
+
data.tar.gz: 0475ba04a25d6eeca5e7acbc9867ca33f8faf55366ba220996031438eabceb9c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e2649960dd466f7d951d0633cf24ca34637c1d34de9ff6dfc6b530211f492b612cd3377bb54c87dd473f5d9e12ed7c2e35f4c5f371d9abfc9de1d1425848aec6
|
|
7
|
+
data.tar.gz: 1da3998eba6755e4363267240609a706f8bc8f26e54b39e04b05eb04475a18ddbf7283ac2d6b679b3a900498e89ed0eb0a77904044bd40e0952bb48fb0e456b2
|
data/lib/jekyll/line_awesome.rb
CHANGED
|
@@ -25,15 +25,26 @@
|
|
|
25
25
|
# Line Awesome Icons Liquid Tag
|
|
26
26
|
# Documentation can be found at https://icons8.com/line-awesome
|
|
27
27
|
#
|
|
28
|
+
# Line Awesome ships three icon families sharing one glyph namespace: 'las' (solid, the
|
|
29
|
+
# default here), 'lar' (regular/outline) and 'lab' (brands - Twitter, Facebook, Apple, etc.,
|
|
30
|
+
# who only exist in this family). Because all three families' CSS rules carry equal
|
|
31
|
+
# specificity, whichever one is declared last in the compiled stylesheet always wins if more
|
|
32
|
+
# than one is present on the same element - so brand icons render nothing under the default
|
|
33
|
+
# 'las' class, and must explicitly switch families rather than add 'lab' alongside it.
|
|
34
|
+
#
|
|
28
35
|
# Example:
|
|
29
36
|
# {% icon la-camera-retro %}
|
|
30
37
|
# {% icon la-camera-retro la-lg %}
|
|
31
38
|
# {% icon la-spinner la-spin %}
|
|
32
39
|
# {% icon la-shield la-rotate-90 %}
|
|
40
|
+
# {% icon la-twitter lab %} # brand icon: replaces the family, doesn't just add a class
|
|
41
|
+
# {% icon la-star lar %} # outline/regular style instead of the default solid
|
|
33
42
|
|
|
34
43
|
module Jekyll
|
|
35
44
|
class LineAwesomeTag < Liquid::Tag
|
|
36
45
|
|
|
46
|
+
ICON_FAMILIES = %w[las lar lab].freeze
|
|
47
|
+
|
|
37
48
|
def render(context)
|
|
38
49
|
if tag_contents = determine_arguments(@markup.strip)
|
|
39
50
|
icon_class, icon_extra = tag_contents[0], tag_contents[1]
|
|
@@ -47,6 +58,7 @@ Syntax error in tag 'icon' while parsing the following markup:
|
|
|
47
58
|
Valid syntax:
|
|
48
59
|
for icons: {% icon la-camera-retro %}
|
|
49
60
|
for icons with size/spin/rotate: {% icon la-camera-retro la-lg %}
|
|
61
|
+
for a non-default family (lar/lab): {% icon la-twitter lab %}
|
|
50
62
|
eos
|
|
51
63
|
end
|
|
52
64
|
end
|
|
@@ -59,10 +71,13 @@ eos
|
|
|
59
71
|
end
|
|
60
72
|
|
|
61
73
|
def icon_tag(icon_class, icon_extra = nil)
|
|
62
|
-
|
|
63
|
-
|
|
74
|
+
family = ICON_FAMILIES.include?(icon_extra) ? icon_extra : 'las'
|
|
75
|
+
modifier = ICON_FAMILIES.include?(icon_extra) ? nil : icon_extra
|
|
76
|
+
|
|
77
|
+
if modifier.nil? || modifier.empty?
|
|
78
|
+
"<i class=\"#{family} #{icon_class}\"></i>"
|
|
64
79
|
else
|
|
65
|
-
"<i class=\"
|
|
80
|
+
"<i class=\"#{family} #{icon_class} #{modifier}\"></i>"
|
|
66
81
|
end
|
|
67
82
|
end
|
|
68
83
|
end
|
|
@@ -3,10 +3,24 @@ module Jekyll
|
|
|
3
3
|
safe true
|
|
4
4
|
|
|
5
5
|
def generate(site)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
data/lib/octopod/version.rb
CHANGED