jekyll-octopod 0.16.1 → 0.17.1

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: 1e97c76791da4caf394541907199b2009985f42854b547c8644321d057f1ca36
4
- data.tar.gz: 0e0b22eba05771002edc86a2894dbae32fa67ad1bda9d9b348b601d5c794b006
3
+ metadata.gz: 241f37f4351eb2298f41b9b28476283589b7ce79ac82a70fe2926de580e43796
4
+ data.tar.gz: f0a1fe92888438a64c9f340a1f8520f3a5158e90c45cc6be2150227935dd1843
5
5
  SHA512:
6
- metadata.gz: b5bef749f76e82144d8b4755339710ff8a87392e8bfea9f0c30899c7fbc67c22913c6f4b100a0ad2a05b91f68a2817d1759ca7a52c169c1370dd0e123e248601
7
- data.tar.gz: 65125e024416c0d9218ca8543fc4c641fd1dbefa1af2d9b2f9ba67a3a7f875825ef08be5adf5c711c2d47ed2c034843fe709d2714e1da792e5661ce5f285ebc3
6
+ metadata.gz: d87e120cb798a302dc0a45e57eeaa574cdfec3eda5addb3a7ae01f3ca5272bfc8d31c9c9b3d09ecefa3da351498d5eedaf7f2ceb87b0badfdc3ed815d1d15bc5
7
+ data.tar.gz: ae65359cd2e30620cd8d75edcbdb0d368f277a948c98d64ddc71df6bc39b1f21f1e13249688578dff3812a71f2a412c726d272758de56f70fede708c6b9108e5
data/bin/octopod CHANGED
@@ -2,7 +2,8 @@
2
2
  # require "byebug"
3
3
  PWD = Dir.pwd
4
4
 
5
- GEM_DIR = Gem::Specification.find_by_name("jekyll-octopod").gem_dir
5
+ GEM_SPEC = Gem::Specification.find_by_name("jekyll-octopod")
6
+ GEM_DIR = GEM_SPEC.gem_dir
6
7
  # HAS20170501 disgusting hack for development
7
8
  # GEM_DIR = "/home/user/jekyll/jekyll-octopod/"
8
9
 
@@ -28,6 +29,11 @@ Basic Command Line Usage:
28
29
  Additional Octopod commands:
29
30
  octopod episode # adds a template for a new episode
30
31
  octopod deploy # deploys your site
32
+ octopod update # updates template files from an existing setup to
33
+ # the currently installed jekyll-octopod version,
34
+ # without touching posts, imprint.md or index.md,
35
+ # and rewrites the old '{% podigee_player %}' tag
36
+ # to '{% podlove_player %}' wherever it's still used
31
37
 
32
38
  See 'octopod <command> --help' for more information on a specific command.
33
39
 
@@ -110,7 +116,7 @@ def get_stdin(message)
110
116
  STDIN.gets.chomp
111
117
  end
112
118
 
113
- if ARGV.size > 0 && (ARGV[0] == 'episode' || ARGV[0] == 'deploy' || ARGV[0] == 'setup')
119
+ if ARGV.size > 0 && (ARGV[0] == 'episode' || ARGV[0] == 'deploy' || ARGV[0] == 'setup' || ARGV[0] == 'update')
114
120
  options = YAML.load_file(File.join(PWD, '_config.yml'))
115
121
  options['posts_dir'] = File.join(PWD, '_posts')
116
122
 
@@ -271,6 +277,44 @@ if ARGV.size > 0 && (ARGV[0] == 'episode' || ARGV[0] == 'deploy' || ARGV[0] == '
271
277
  FileUtils.cp(GEM_DIR + "/assets/_config.yml.sample", PWD + "/_config.yml", verbose: true)
272
278
  end
273
279
  puts "===== ... done ===== ", ""
280
+
281
+ when 'update'
282
+ # Paths that are always left alone: real posts, hand-written content pages, and the gem's
283
+ # demo episode audio. Unlike 'setup', these are skipped outright rather than offered as a
284
+ # per-file prompt, since this command targets sites that are already live.
285
+ skip_on_update = %w[_posts imprint.md index.md episodes]
286
+
287
+ update_file = lambda do |file|
288
+ relative = file.split(GEM_DIR + "/assets")[1]
289
+ next if skip_on_update.any? { |skip| relative == "/#{skip}" || relative.start_with?("/#{skip}/") }
290
+ copy_file_or_create_dir(file)
291
+ end
292
+
293
+ puts "", "===== Updating template files to jekyll-octopod #{GEM_SPEC.version} ... ====="
294
+ puts "_posts/, imprint.md, index.md and the demo episodes/ directory are left untouched."
295
+ puts "You'll be asked before any other existing file gets overwritten.", ""
296
+
297
+ Dir.glob(GEM_DIR + "/assets/**/*").each(&update_file)
298
+ Dir.glob(GEM_DIR + "/assets/**/.*").each(&update_file)
299
+ puts "===== ... done ===== ", ""
300
+
301
+ puts "", "===== Rewriting the old '{% podigee_player %}' tag to '{% podlove_player %}' ... ====="
302
+ podigee_player_tag = /\{%-?\s*podigee_player\b.*?-?%\}/
303
+ updated_posts = Dir.glob(File.join(options['posts_dir'], '**', '*')).select do |post_file|
304
+ next false unless File.file?(post_file)
305
+ content = File.read(post_file)
306
+ next false unless content.match?(podigee_player_tag)
307
+ File.write(post_file, content.gsub(podigee_player_tag, '{% podlove_player %}'))
308
+ true
309
+ end
310
+
311
+ if updated_posts.empty?
312
+ puts "No posts used the old 'podigee_player' tag."
313
+ else
314
+ puts "Updated:"
315
+ updated_posts.each { |post_file| puts " #{post_file}" }
316
+ end
317
+ puts "===== ... done ===== ", ""
274
318
  end
275
319
  else
276
320
  puts octopod_help if ARGV.size > 0 && ARGV[0] == '--help'
@@ -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
- if icon_extra.empty?
63
- "<i class=\"las #{icon_class}\"></i>"
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=\"las #{icon_class} #{icon_extra}\"></i>"
80
+ "<i class=\"#{family} #{icon_class} #{modifier}\"></i>"
66
81
  end
67
82
  end
68
83
  end
@@ -2,7 +2,7 @@ module Jekyll
2
2
  class Octopod
3
3
  module VERSION #:nodoc:
4
4
  MAJOR = 0
5
- MINOR = 16
5
+ MINOR = 17
6
6
  TINY = 1
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY].join('.')
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.16.1
4
+ version: 0.17.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arne Eilermann