jekyll-theme-isotc211-helpers 0.5.1 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18514a72710e52ab9e597cdaaf04d060c861d4577654ede701b0917b033441a2
|
4
|
+
data.tar.gz: 4cc8d131a4372a249589ee3adbfd2515091b414281379c6ace7bd32a0778c519
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff143f23193ea76f1976212b07ec0e4d6ac6a5271f8b3e291168a77aba8ebe735a834f4c5bc9e8f470f66bca2c083f38a0ed3fb026bde512b2f1aaad96913534
|
7
|
+
data.tar.gz: 1d76bde595eb14cb513ee658249385d7f139a290367111d63fafbb8719917bdf9aacd9a96a95eb2c54065af243a405d62ee00014c3233d81edad27a159438c8d
|
data/Rakefile
ADDED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = 'jekyll-theme-isotc211-helpers'
|
5
|
-
s.version = '0.
|
5
|
+
s.version = '0.6.1'
|
6
6
|
s.authors = ['Ribose Inc.']
|
7
7
|
s.email = ['open.source@ribose.com']
|
8
8
|
|
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
|
|
12
12
|
|
13
13
|
s.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r!^(test|spec|features)/!) }
|
14
14
|
|
15
|
-
s.add_runtime_dependency 'jekyll', '~>
|
15
|
+
s.add_runtime_dependency 'jekyll', '~> 4.0'
|
16
16
|
s.add_development_dependency 'rake', '~> 12.0'
|
17
17
|
s.add_development_dependency 'rubocop', '~> 0.50'
|
18
18
|
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# Copies resource contents as is to site destination, bypassing Jekyll’s conversion
|
2
|
+
|
3
|
+
Jekyll::Hooks.register :site, :post_write do |site|
|
4
|
+
if site.config.key?('resource_listings')
|
5
|
+
site.config['resource_listings'].each do |listing_id, cfg|
|
6
|
+
copy_resource_contents(cfg, site.config['destination'])
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
def copy_resource_contents(resource_cfg, site_dest)
|
12
|
+
FileUtils.cp_r("#{resource_cfg['resource_root']}/.", "#{site_dest}/#{resource_cfg['index_url']}")
|
13
|
+
end
|
@@ -20,6 +20,8 @@ module Jekyll
|
|
20
20
|
|
21
21
|
self.process(@name)
|
22
22
|
|
23
|
+
puts resources
|
24
|
+
|
23
25
|
self.data = {
|
24
26
|
'layout' => layout || 'resource-index',
|
25
27
|
'title' => header,
|
@@ -75,34 +77,36 @@ module Jekyll
|
|
75
77
|
contents_tree)
|
76
78
|
end
|
77
79
|
|
80
|
+
# Returns a data structure representing a tree of resource subdirectories & files
|
78
81
|
def read_resource_contents(dir, id, listing_id)
|
79
82
|
cfg = self.config['resource_listings'][listing_id]
|
80
|
-
|
83
|
+
directory_hash(dir, "#{cfg['resource_label'].capitalize} #{id}")
|
81
84
|
end
|
82
85
|
|
83
86
|
def generate_resource_pages
|
84
|
-
|
87
|
+
return unless self.config.key?('resource_listings')
|
88
|
+
|
89
|
+
self.config['resource_listings'].each do |listing_id, cfg|
|
90
|
+
resources = {}
|
85
91
|
|
86
|
-
|
87
|
-
resources = {}
|
92
|
+
Pathname(cfg['resource_root']).children.sort.each do |resource_dir|
|
88
93
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
# Ignore dot-directories
|
93
|
-
next
|
94
|
-
end
|
94
|
+
# Ignore non-directories
|
95
|
+
next unless File.directory?(resource_dir)
|
96
|
+
basename = File.basename(resource_dir)
|
95
97
|
|
96
|
-
|
97
|
-
|
98
|
-
contents = self.read_resource_contents(resource_dir.to_s, id, listing_id)
|
99
|
-
self.write_resource_page(listing_id, id, contents)
|
100
|
-
end
|
98
|
+
# Ignore dot-directories
|
99
|
+
next if basename[0] == '.'
|
101
100
|
|
102
|
-
|
101
|
+
id = basename
|
102
|
+
resources[id] = {} # Empty hash can in future be resource metadata
|
103
|
+
contents = self.read_resource_contents(resource_dir.to_s, id, listing_id)
|
104
|
+
self.write_resource_page(listing_id, id, contents)
|
103
105
|
end
|
104
106
|
|
107
|
+
self.write_resource_listing_page(listing_id, resources)
|
105
108
|
end
|
109
|
+
|
106
110
|
end
|
107
111
|
|
108
112
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-theme-isotc211-helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '4.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '4.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0.50'
|
55
|
-
description:
|
55
|
+
description:
|
56
56
|
email:
|
57
57
|
- open.source@ribose.com
|
58
58
|
executables: []
|
@@ -61,15 +61,17 @@ extra_rdoc_files: []
|
|
61
61
|
files:
|
62
62
|
- LICENSE.txt
|
63
63
|
- README.md
|
64
|
+
- Rakefile
|
64
65
|
- develop/release
|
65
66
|
- jekyll-theme-isotc211-helpers.gemspec
|
66
67
|
- lib/jekyll-theme-isotc211-helpers.rb
|
68
|
+
- lib/jekyll-theme-isotc211-helpers/resource_copy.rb
|
67
69
|
- lib/jekyll-theme-isotc211-helpers/resource_listing.rb
|
68
70
|
homepage: https://github.com/riboseinc/jekyll-theme-isotc211-helpers/
|
69
71
|
licenses:
|
70
72
|
- MIT
|
71
73
|
metadata: {}
|
72
|
-
post_install_message:
|
74
|
+
post_install_message:
|
73
75
|
rdoc_options: []
|
74
76
|
require_paths:
|
75
77
|
- lib
|
@@ -84,9 +86,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
84
86
|
- !ruby/object:Gem::Version
|
85
87
|
version: '0'
|
86
88
|
requirements: []
|
87
|
-
|
88
|
-
|
89
|
-
signing_key:
|
89
|
+
rubygems_version: 3.0.3
|
90
|
+
signing_key:
|
90
91
|
specification_version: 4
|
91
92
|
summary: Helpers for the ISO/TC 211 Jekyll theme
|
92
93
|
test_files: []
|