jekyll-octopod 0.18.1 → 0.18.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/bin/octopod +35 -2
- 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: 3e95c321128dfae975297d56250d21c9f7f47183ee0a4e54aaad16dd2541d210
|
|
4
|
+
data.tar.gz: 7cab5b2868fece52002befdef60aa5a286fdcd87584e004cf06d3462598090f1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3331337c0ff0ee9b95376ab00899364f7032b549711bf8a6fa4e556c5d61a190fd495e08b4fa73e2847890b4a161eac4614ec6ab0f7a3cb490dc38d509d52836
|
|
7
|
+
data.tar.gz: 52d377821ee236e2d25e578835e742811a2aa25d93f517a7898f542c4cc23e474a5e3812fae2164c6d8e91d7ab8b893b149a6f1f15268329d74985b1ff8ae4eb
|
data/bin/octopod
CHANGED
|
@@ -120,9 +120,42 @@ def remove_theme_served_path(path)
|
|
|
120
120
|
FileUtils.rmdir(path, verbose: true) if Dir.exist?(path) && Dir.empty?(path)
|
|
121
121
|
elsif !path.end_with?('.md')
|
|
122
122
|
FileUtils.rm(path, verbose: true)
|
|
123
|
+
# Clean up now-empty parent directories this file leaves behind (e.g. img/logo/ once every
|
|
124
|
+
# generic favicon file under it is gone), but never touch PWD itself and never remove a
|
|
125
|
+
# directory that still holds real, unrelated content (a site's own photos alongside the
|
|
126
|
+
# generic ones, say) - Dir.empty? guards that.
|
|
127
|
+
parent = File.dirname(path)
|
|
128
|
+
while parent != PWD && Dir.exist?(parent) && Dir.empty?(parent)
|
|
129
|
+
FileUtils.rmdir(parent, verbose: true)
|
|
130
|
+
parent = File.dirname(parent)
|
|
131
|
+
end
|
|
123
132
|
end
|
|
124
133
|
end
|
|
125
134
|
|
|
135
|
+
# 'now_theme_served' used to list '_layouts' and 'img' wholesale, on the assumption that a legacy
|
|
136
|
+
# site's copies of those directories were 100% gem output. That's wrong whenever a site added its
|
|
137
|
+
# own files alongside them - a custom '_layouts/presentation.html' with no gem equivalent, or real
|
|
138
|
+
# content photos dropped into 'img/' - since a whole-directory delete has no way to tell those apart
|
|
139
|
+
# from the generic files it's supposed to clean up. This instead lists the theme gem's *actual*
|
|
140
|
+
# shipped filenames in those two directories, read from the installed jekyll-octopod-bulma gem
|
|
141
|
+
# itself (same reasoning as the version-constraint lookup in update_gemfile_and_theme_config: read
|
|
142
|
+
# from the gem so this can't drift out of sync as its shipped file list changes) - so 'update' only
|
|
143
|
+
# ever removes a file that's actually theme content, and leaves anything else in place.
|
|
144
|
+
def theme_shipped_generic_files
|
|
145
|
+
theme_gem_dir = begin
|
|
146
|
+
Gem::Specification.find_by_name('jekyll-octopod-bulma').gem_dir
|
|
147
|
+
rescue Gem::MissingSpecError
|
|
148
|
+
nil
|
|
149
|
+
end
|
|
150
|
+
return [] unless theme_gem_dir
|
|
151
|
+
|
|
152
|
+
layouts = Dir.glob(File.join(theme_gem_dir, '_layouts', '*')).map { |f| "_layouts/#{File.basename(f)}" }
|
|
153
|
+
img = Dir.glob(File.join(theme_gem_dir, 'assets', 'img', '**', '*'), File::FNM_DOTMATCH)
|
|
154
|
+
.reject { |f| File.directory?(f) }
|
|
155
|
+
.map { |f| f.sub("#{theme_gem_dir}/assets/", '') }
|
|
156
|
+
layouts + img
|
|
157
|
+
end
|
|
158
|
+
|
|
126
159
|
# Points a site's Gemfile and _config.yml at jekyll-octopod-bulma instead of the old direct
|
|
127
160
|
# jekyll-bulma dependency/theme setting. Mirrors the version constraint this gem itself declares on
|
|
128
161
|
# jekyll-octopod-bulma (see jekyll-octopod.gemspec) rather than hardcoding one here, so it can't
|
|
@@ -371,8 +404,8 @@ if ARGV.size > 0 && (ARGV[0] == 'episode' || ARGV[0] == 'deploy' || ARGV[0] == '
|
|
|
371
404
|
# point at it - so 'update' removes them outright, same "trust git diff, don't special-case"
|
|
372
405
|
# philosophy as the rest of this command. Any '.md' file is kept no matter where it's found,
|
|
373
406
|
# since that's real content, never theme boilerplate.
|
|
374
|
-
now_theme_served = %w[
|
|
375
|
-
|
|
407
|
+
now_theme_served = theme_shipped_generic_files + %w[
|
|
408
|
+
podlove-player subscribe-button favicon.ico apple-touch-icon-precomposed.png
|
|
376
409
|
_includes/sidebar.html _includes/post_header.html _includes/post.html _includes/post_line.html
|
|
377
410
|
_includes/disqus_thread.html _includes/disqus_count.html _includes/isso_thread.html
|
|
378
411
|
]
|
data/lib/octopod/version.rb
CHANGED