jekyll-readme-index 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jekyll-readme-index/generator.rb +18 -0
- data/lib/jekyll-readme-index/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b0cb46a6f56d8a5898262b8b61441de116c84ad
|
4
|
+
data.tar.gz: '0992bcb775494cd0fa27d842877b8c397a79a3a1'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a11b7475e60decc7ebb9640117f49619ac4745d5038f4bd36953dca3fe743fbef59724df995450cf07448c17af08db03a4bf2e66bfab94c023f4f9abf9e62e17
|
7
|
+
data.tar.gz: 7b22c70e35d4562c3884da6915632e1af7135b5d93374473b0a818461ebed11976e5e6c0a290209c6e2d85faff96cb43eb63cb00d970616284a1212b6cc6ddd0
|
@@ -7,16 +7,22 @@ module JekyllReadmeIndex
|
|
7
7
|
safe true
|
8
8
|
priority :low
|
9
9
|
|
10
|
+
CONFIG_KEY = "readme_index".freeze
|
11
|
+
ENABLED_KEY = "enabled".freeze
|
12
|
+
CLEANUP_KEY = "remove_originals".freeze
|
13
|
+
|
10
14
|
def initialize(site)
|
11
15
|
@site = site
|
12
16
|
end
|
13
17
|
|
14
18
|
def generate(site)
|
15
19
|
@site = site
|
20
|
+
return if disabled?
|
16
21
|
|
17
22
|
readmes.each do |readme|
|
18
23
|
next unless should_be_index?(readme)
|
19
24
|
site.pages << readme.to_page
|
25
|
+
site.static_files.delete(readme) if cleanup?
|
20
26
|
end
|
21
27
|
end
|
22
28
|
|
@@ -50,5 +56,17 @@ module JekyllReadmeIndex
|
|
50
56
|
def markdown_converter
|
51
57
|
@markdown_converter ||= site.find_converter_instance(Jekyll::Converters::Markdown)
|
52
58
|
end
|
59
|
+
|
60
|
+
def option(key)
|
61
|
+
site.config[CONFIG_KEY] && site.config[CONFIG_KEY][key]
|
62
|
+
end
|
63
|
+
|
64
|
+
def disabled?
|
65
|
+
option(ENABLED_KEY) == false
|
66
|
+
end
|
67
|
+
|
68
|
+
def cleanup?
|
69
|
+
option(CLEANUP_KEY) == true
|
70
|
+
end
|
53
71
|
end
|
54
72
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-readme-index
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Balter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-09-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -83,7 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
83
|
version: '0'
|
84
84
|
requirements: []
|
85
85
|
rubyforge_project:
|
86
|
-
rubygems_version: 2.
|
86
|
+
rubygems_version: 2.6.11
|
87
87
|
signing_key:
|
88
88
|
specification_version: 4
|
89
89
|
summary: A Jekyll plugin to render a project's README as the site's index.
|