jekyll-bookshop 1.4.4 → 1.4.6
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/lib/jekyll-bookshop.rb +32 -7
- data/lib/jekyll-bookshop/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7dd4ef9bde09e47ceb17a1513634053ecec2559487cdf7d70c4979da29cb54d
|
4
|
+
data.tar.gz: 3249af02f3aa9014c62101f8c82cdde9f533a9ef5c5bc29262e6cafed69f0241
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e57ad713b8e3c127bf7c6f011b1d549e673c466df55b6f6545411af6b907555f980ed55272edff89581477bb117abc88d001627d790934a6684b26612624307f
|
7
|
+
data.tar.gz: ea2368741bd50509f51777c67144c808bc5dbc36fb937baaa010bf9666fe6f95756b81aa803628ba28152bc32a8cf8180e41ae358119076c1e5d7d3a131653db
|
data/lib/jekyll-bookshop.rb
CHANGED
@@ -3,18 +3,13 @@ require 'pathname'
|
|
3
3
|
|
4
4
|
module JekyllBookshop
|
5
5
|
class Tag < Jekyll::Tags::IncludeTag
|
6
|
-
def initialize(tag_name, markup, tokens)
|
7
|
-
cpath = markup.strip.partition(" ").first
|
8
|
-
cname = cpath.strip.split("/").last
|
9
|
-
tag = markup.strip.partition(" ").last
|
10
|
-
markup = "#{cpath}/#{cname}.jekyll.html #{tag}"
|
11
|
-
super
|
12
|
-
end
|
13
6
|
|
7
|
+
# Look for includes in the built bookshop directory
|
14
8
|
def tag_includes_dirs(context)
|
15
9
|
Array(Pathname.new(context['site']['bookshop_path'] + '/components').cleanpath.to_s).freeze
|
16
10
|
end
|
17
11
|
|
12
|
+
# Support the bind syntax, spreading an object into params
|
18
13
|
def parse_params(context)
|
19
14
|
params = super
|
20
15
|
|
@@ -28,9 +23,39 @@ module JekyllBookshop
|
|
28
23
|
|
29
24
|
params
|
30
25
|
end
|
26
|
+
|
27
|
+
# Map component names to the .jekyll.html files found in bookshop
|
28
|
+
def render(context)
|
29
|
+
site = context.registers[:site]
|
30
|
+
|
31
|
+
file = render_variable(context) || @file
|
32
|
+
cname = file.strip.split("/").last
|
33
|
+
file = "#{file}/#{cname}.jekyll.html"
|
34
|
+
validate_file_name(file)
|
35
|
+
|
36
|
+
path = locate_include_file(context, file, site.safe)
|
37
|
+
return unless path
|
38
|
+
|
39
|
+
add_include_to_dependency(site, path, context)
|
40
|
+
|
41
|
+
partial = load_cached_partial(path, context)
|
42
|
+
|
43
|
+
context.stack do
|
44
|
+
context["include"] = parse_params(context) if @params
|
45
|
+
begin
|
46
|
+
partial.render!(context)
|
47
|
+
rescue Liquid::Error => e
|
48
|
+
e.template_name = path
|
49
|
+
e.markup_context = "included " if e.markup_context.nil?
|
50
|
+
raise e
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
31
54
|
end
|
32
55
|
|
33
56
|
class Styles
|
57
|
+
|
58
|
+
# Add the paths to find bookshop's styles
|
34
59
|
def self.open_bookshop(site)
|
35
60
|
bookshop_path = site.theme.root + '/_bookshop'
|
36
61
|
site.config['bookshop_path'] = Pathname.new(bookshop_path).cleanpath.to_s
|
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: 1.4.
|
4
|
+
version: 1.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Liam Bigelow
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|