jekyll-postfiles 3.0.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -14
- data/RELEASES.md +5 -1
- data/lib/jekyll/postfiles.rb +15 -15
- data/lib/jekyll/postfiles/version.rb +1 -1
- metadata +18 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e7dc0cb82c861a2f14092ef9664291651760d71c69d41786cff0bf76091c2cf9
|
4
|
+
data.tar.gz: 129cd062a00abd283c0a8791b9ff9a211a0a82c8f933817f30a907b0f6e2014e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d87e22beb4a388e7b6d26f3b22f9257c673a39677fa8974235d495fe2afe386554ceca316342d17fade08fab9ba23b018f0bb10ff7601b071cea55271a79b532
|
7
|
+
data.tar.gz: 291201525071a65323493fb06cf8312b043c444c0b1bf0996665b28afc0dad6a7d1b0659462bb95cebd7acfdbc7c22fa174c9e1d3751ce7756ee6c9a2b346b0c
|
data/README.md
CHANGED
@@ -174,34 +174,33 @@ Handy, isn't it?
|
|
174
174
|
|
175
175
|
## Installation
|
176
176
|
|
177
|
-
Add
|
177
|
+
Add `gem 'jekyll-postfiles'` to the `jekyll_plugin` group in your `Gemfile`:
|
178
178
|
|
179
179
|
```ruby
|
180
|
-
|
181
|
-
```
|
180
|
+
source 'https://rubygems.org'
|
182
181
|
|
183
|
-
|
182
|
+
gem 'jekyll'
|
184
183
|
|
185
|
-
|
186
|
-
|
184
|
+
group :jekyll_plugins do
|
185
|
+
gem 'jekyll-postfiles'
|
186
|
+
end
|
187
187
|
```
|
188
188
|
|
189
|
-
|
190
|
-
|
191
|
-
```yaml
|
192
|
-
gems:
|
193
|
-
- jekyll-postfiles
|
194
|
-
```
|
189
|
+
Then run `bundle` to install the gem.
|
195
190
|
|
196
191
|
## Usage
|
197
192
|
|
198
193
|
You don't have anything to do.
|
199
194
|
|
200
|
-
Just put the images (and PDFs, etc.) in the same folder as your Markdown files, and use the standard Markdown image syntax,
|
195
|
+
Just put the images (and PDFs, etc.) in the same folder as your Markdown files, or even subfolders, and use the standard Markdown image syntax, with a relative path.
|
196
|
+
|
197
|
+
## Compatibility
|
198
|
+
|
199
|
+
:warning: This plugin is not supported by Github Pages, host your site on services like https://netlify.com which support third party plugins.
|
201
200
|
|
202
201
|
## Contributing
|
203
202
|
|
204
|
-
Thanks for your interest in contributing! There are many ways to contribute to this project. Get started here
|
203
|
+
Thanks for your interest in contributing! There are many ways to contribute to this project. [Get started here](https://github.com/nhoizey/jekyll-postfiles/blob/master/CONTRIBUTING.md).
|
205
204
|
|
206
205
|
## License
|
207
206
|
|
data/RELEASES.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
# Releases
|
2
2
|
|
3
|
-
##
|
3
|
+
## v3.1.0
|
4
|
+
|
5
|
+
- [Supports Jekyll 4](https://github.com/nhoizey/jekyll-postfiles/commit/9dbb9778fb5cc8036aa819a8476a348a72c10e69)
|
6
|
+
|
7
|
+
## v3.0.0
|
4
8
|
|
5
9
|
- [Rewrite for Jekyll 3.8.0](https://github.com/nhoizey/jekyll-postfiles/pull/12) by [@Birch-san](https://github.com/Birch-san)
|
6
10
|
- Match jekyll's coding style thanks to [Rubocop](http://rubocop.readthedocs.io/)
|
data/lib/jekyll/postfiles.rb
CHANGED
@@ -20,7 +20,7 @@ module Jekyll
|
|
20
20
|
#
|
21
21
|
# our plugin changes the regex, to:
|
22
22
|
# avoid false positive when directory name matches date regex
|
23
|
-
Hooks.register :site, :after_reset do |
|
23
|
+
Hooks.register :site, :after_reset do |_site|
|
24
24
|
# Suppress warning messages.
|
25
25
|
original_verbose = $VERBOSE
|
26
26
|
$VERBOSE = nil
|
@@ -48,13 +48,13 @@ module Jekyll
|
|
48
48
|
# dest - The String path to the destination dir.
|
49
49
|
#
|
50
50
|
# Returns destination file path.
|
51
|
-
def destination(
|
51
|
+
def destination(_dest)
|
52
52
|
File.join(@dest, @name)
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
56
|
class PostFileGenerator < Generator
|
57
|
-
FIXED_DATE_FILENAME_MATCHER = %r!^(?:.+/)*(\d{2,4}-\d{1,2}-\d{1,2})-([^/]*)(\.[^.]+)
|
57
|
+
FIXED_DATE_FILENAME_MATCHER = %r!^(?:.+/)*(\d{2,4}-\d{1,2}-\d{1,2})-([^/]*)(\.[^.]+)$!.freeze
|
58
58
|
|
59
59
|
# _posts/
|
60
60
|
# 2018-01-01-whatever.md # there's a date on this filename, so it will be treated as a post
|
@@ -75,23 +75,23 @@ module Jekyll
|
|
75
75
|
# Jekyll.logger.warn("[PostFiles]", "docs: #{site.posts.docs.map(&:path)}")
|
76
76
|
|
77
77
|
docs_with_dirs = site.posts.docs
|
78
|
-
.reject
|
79
|
-
Pathname.new(doc.path).dirname.instance_eval
|
80
|
-
[posts_src_dir, drafts_src_dir].reduce(false)
|
78
|
+
.reject do |doc|
|
79
|
+
Pathname.new(doc.path).dirname.instance_eval do |dirname|
|
80
|
+
[posts_src_dir, drafts_src_dir].reduce(false) do |acc, dir|
|
81
81
|
acc || dirname.eql?(dir)
|
82
|
-
|
83
|
-
|
84
|
-
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
85
|
|
86
86
|
# Jekyll.logger.warn("[PostFiles]", "postdirs: #{docs_with_dirs.map{|doc| Pathname.new(doc.path).dirname}}")
|
87
87
|
|
88
|
-
assets = docs_with_dirs.map
|
88
|
+
assets = docs_with_dirs.map do |doc|
|
89
89
|
dest_dir = Pathname.new(doc.destination("")).dirname
|
90
|
-
Pathname.new(doc.path).dirname.instance_eval
|
90
|
+
Pathname.new(doc.path).dirname.instance_eval do |postdir|
|
91
91
|
Dir[postdir + "**/*"]
|
92
92
|
.reject { |fname| fname =~ FIXED_DATE_FILENAME_MATCHER }
|
93
93
|
.reject { |fname| File.directory? fname }
|
94
|
-
.map
|
94
|
+
.map do |fname|
|
95
95
|
asset_abspath = Pathname.new fname
|
96
96
|
srcroot_to_asset = asset_abspath.relative_path_from(site_srcroot)
|
97
97
|
srcroot_to_assetdir = srcroot_to_asset.dirname
|
@@ -100,9 +100,9 @@ module Jekyll
|
|
100
100
|
assetdir_abs = site_srcroot + srcroot_to_assetdir
|
101
101
|
postdir_to_assetdir = assetdir_abs.relative_path_from(postdir)
|
102
102
|
PostFile.new(site, site_srcroot, srcroot_to_assetdir.to_path, asset_basename, (dest_dir + postdir_to_assetdir).to_path)
|
103
|
-
|
104
|
-
|
105
|
-
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end.flatten
|
106
106
|
|
107
107
|
site.static_files.concat(assets)
|
108
108
|
end
|
metadata
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-postfiles
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicolas Hoizey
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 3.8.6
|
20
|
+
- - "<"
|
18
21
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
22
|
+
version: '5'
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
29
|
+
version: 3.8.6
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '5'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: bundler
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,28 +50,28 @@ dependencies:
|
|
44
50
|
requirements:
|
45
51
|
- - "~>"
|
46
52
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
53
|
+
version: '13.0'
|
48
54
|
type: :development
|
49
55
|
prerelease: false
|
50
56
|
version_requirements: !ruby/object:Gem::Requirement
|
51
57
|
requirements:
|
52
58
|
- - "~>"
|
53
59
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
60
|
+
version: '13.0'
|
55
61
|
- !ruby/object:Gem::Dependency
|
56
62
|
name: rubocop
|
57
63
|
requirement: !ruby/object:Gem::Requirement
|
58
64
|
requirements:
|
59
65
|
- - "~>"
|
60
66
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.
|
67
|
+
version: 0.76.0
|
62
68
|
type: :development
|
63
69
|
prerelease: false
|
64
70
|
version_requirements: !ruby/object:Gem::Requirement
|
65
71
|
requirements:
|
66
72
|
- - "~>"
|
67
73
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.
|
74
|
+
version: 0.76.0
|
69
75
|
description: " This plugin takes any file that is in posts folders, and copy them
|
70
76
|
to the folder in which the post HTML page will be created.\n"
|
71
77
|
email:
|
@@ -94,15 +100,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
94
100
|
requirements:
|
95
101
|
- - ">="
|
96
102
|
- !ruby/object:Gem::Version
|
97
|
-
version:
|
103
|
+
version: 2.3.0
|
98
104
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
99
105
|
requirements:
|
100
106
|
- - ">="
|
101
107
|
- !ruby/object:Gem::Version
|
102
108
|
version: '0'
|
103
109
|
requirements: []
|
104
|
-
|
105
|
-
rubygems_version: 2.7.4
|
110
|
+
rubygems_version: 3.0.4
|
106
111
|
signing_key:
|
107
112
|
specification_version: 4
|
108
113
|
summary: A Jekyll plugin to keep posts assets alongside their Markdown files
|