jekyll-bookshop 1.5.0 → 2.0.0.pre.alpha.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jekyll-bookshop.rb +47 -11
- data/lib/jekyll-bookshop/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b78bc626f29948998b03084444ff8b55cee28959b1193c39ca7c9ef761e037a2
|
4
|
+
data.tar.gz: 4ddb4263efdec585fea7664ff95fcd039010a2fe81f8a3eea3b857a423f3d9eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ee66af958a4268bd5896974c4e7063e41ca41f3e9b40f84664759fcca8605d233ec7733de00ee3a813ba1135e6d7a9a224c8f5603aca33e56fd05cba6c0e9827
|
7
|
+
data.tar.gz: 00f8d7660e47594a2bbe0fd3bf2593864f34d4d69408de18c636f7f042bc798722b74a07365c58ceedb3536151bbb57e4fecf71e78dafe9f49f3738a9f4d8777
|
data/lib/jekyll-bookshop.rb
CHANGED
@@ -6,10 +6,10 @@ module JekyllBookshop
|
|
6
6
|
|
7
7
|
# Look for includes in the built bookshop directory
|
8
8
|
def tag_includes_dirs(context)
|
9
|
-
|
10
|
-
Pathname.new(
|
11
|
-
|
12
|
-
|
9
|
+
bookshop_locations = context['site']['bookshop_locations']&.collect do |location|
|
10
|
+
Pathname.new(location + "/components").cleanpath.to_s
|
11
|
+
end
|
12
|
+
bookshop_locations.freeze
|
13
13
|
end
|
14
14
|
|
15
15
|
# Support the bind syntax, spreading an object into params
|
@@ -24,6 +24,8 @@ module JekyllBookshop
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
+
params.delete('bind')
|
28
|
+
|
27
29
|
params
|
28
30
|
end
|
29
31
|
|
@@ -56,19 +58,52 @@ module JekyllBookshop
|
|
56
58
|
end
|
57
59
|
end
|
58
60
|
|
61
|
+
class StyleTag < Liquid::Tag
|
62
|
+
def render(context)
|
63
|
+
site = context.registers[:site]
|
64
|
+
|
65
|
+
bookshop_scss_files = []
|
66
|
+
site.config['bookshop_locations']&.each do |location|
|
67
|
+
components_loc = Pathname.new(location + "/").cleanpath.to_s
|
68
|
+
scss_files = Dir.glob(components_loc + "/**/*.scss")&.collect do |scss_file|
|
69
|
+
scss_file.sub!(components_loc+"/", '').sub!(".scss", '')
|
70
|
+
end
|
71
|
+
bookshop_scss_files.push(*scss_files)
|
72
|
+
end
|
73
|
+
|
74
|
+
bookshop_scss_files = bookshop_scss_files&.collect do |file|
|
75
|
+
"@import '#{file}';"
|
76
|
+
end
|
77
|
+
|
78
|
+
output_css = if Jekyll.env == "production"
|
79
|
+
bookshop_scss_files.join("\n")
|
80
|
+
else
|
81
|
+
"html:not([data-bookshop-hmr]) {
|
82
|
+
#{bookshop_scss_files.join("\n")}
|
83
|
+
}"
|
84
|
+
end
|
85
|
+
|
86
|
+
output_css
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
59
90
|
class Styles
|
60
91
|
|
61
92
|
# Add the paths to find bookshop's styles
|
62
93
|
def self.open_bookshop(site)
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
94
|
+
bookshop_locations = site.config['bookshop_locations']&.collect do |location|
|
95
|
+
Pathname.new(location + "/").cleanpath.to_s
|
96
|
+
end
|
97
|
+
bookshop_locations = bookshop_locations.select do |location|
|
98
|
+
Dir.exist?(location)
|
99
|
+
end
|
100
|
+
|
101
|
+
site.config['watch_dirs'] ||= [] # Paired with CloudCannon/jekyll-watch
|
102
|
+
site.config['watch_dirs'].push(*bookshop_locations);
|
67
103
|
|
68
104
|
site.config['sass'] ||= {}
|
69
105
|
site.config['sass']['load_paths'] ||= []
|
70
|
-
site.config['sass']['load_paths'].push(
|
71
|
-
site.config['sass']['load_paths'].push(Pathname.new(bookshop_site_path + '/sass').cleanpath.to_s)
|
106
|
+
site.config['sass']['load_paths'].push(*bookshop_locations)
|
72
107
|
end
|
73
108
|
end
|
74
109
|
|
@@ -94,7 +129,8 @@ module JekyllBookshop
|
|
94
129
|
end
|
95
130
|
end
|
96
131
|
|
97
|
-
Liquid::Template.register_tag("
|
132
|
+
Liquid::Template.register_tag("bookshop", JekyllBookshop::Tag)
|
133
|
+
Liquid::Template.register_tag("bookshop_scss", JekyllBookshop::StyleTag)
|
98
134
|
|
99
135
|
Liquid::Template.register_filter(JekyllBookshop::Filters)
|
100
136
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jekyll-bookshop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0.pre.alpha.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Liam Bigelow
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -54,9 +54,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
54
54
|
version: '0'
|
55
55
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
56
56
|
requirements:
|
57
|
-
- - "
|
57
|
+
- - ">"
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version:
|
59
|
+
version: 1.3.1
|
60
60
|
requirements: []
|
61
61
|
rubygems_version: 3.0.3
|
62
62
|
signing_key:
|