serbea 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/serbea/bridgetown_support.rb +11 -18
- data/lib/serbea/helpers.rb +1 -1
- data/lib/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: 002caf1e91a373f0b94de2cfca37145b80d725205296623276e0693aed768953
|
4
|
+
data.tar.gz: 0b27aa02debeb406fc4896fb497367accbe19250f9fb5d5f022ff256af538da5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 366027ed40d71bc2279c26c11f80dda3dae1345bc14324668f591e8e2a7eece974fc4ab9947c23bc31bbd4a68c4187c17b9761066454d79008626191778083b4
|
7
|
+
data.tar.gz: 537d54b0be5690ad547acf848648061056499fe530bdc434a73e55672202d3f0ae54118a4e4cb92a03aba884a8dfd14a91b447533c708633dfb67a4229d11946
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
The Ruby template language you've always dreamed of is finally here. _Le roi est mort, vive le roi!_
|
4
4
|
|
5
|
-
Serbea combines the best ideas from "brace-style" template languages such as Liquid, Nunjucks, Twig, Jinja, Mustache, etc.—and applies them to the world of ERB. You can use Serbea in Rails
|
5
|
+
Serbea combines the best ideas from "brace-style" template languages such as Liquid, Nunjucks, Twig, Jinja, Mustache, etc.—and applies them to the world of ERB. You can use Serbea in Rails applications, Bridgetown static sites, or pretty much any Ruby scenario you could imagine.
|
6
6
|
|
7
7
|
## Features
|
8
8
|
|
@@ -40,6 +40,8 @@ module Bridgetown
|
|
40
40
|
#
|
41
41
|
# @return [String] The converted content.
|
42
42
|
def convert(content, convertible)
|
43
|
+
return content if convertible.data[:template_engine] != "serbea"
|
44
|
+
|
43
45
|
serb_view = Bridgetown::SerbeaView.new(convertible)
|
44
46
|
|
45
47
|
serb_renderer = Tilt::SerbeaTemplate.new(convertible.relative_path) { content }
|
@@ -53,16 +55,17 @@ module Bridgetown
|
|
53
55
|
end
|
54
56
|
end
|
55
57
|
|
56
|
-
def matches(ext, convertible
|
57
|
-
if convertible
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
end
|
58
|
+
def matches(ext, convertible)
|
59
|
+
if convertible.data[:template_engine] == "serbea" ||
|
60
|
+
(convertible.data[:template_engine].nil? &&
|
61
|
+
@config[:template_engine] == "serbea")
|
62
|
+
convertible.data[:template_engine] = "serbea"
|
63
|
+
return true
|
63
64
|
end
|
64
65
|
|
65
|
-
super(ext)
|
66
|
+
super(ext).tap do |ext_matches|
|
67
|
+
convertible.data[:template_engine] = "serbea" if ext_matches
|
68
|
+
end
|
66
69
|
end
|
67
70
|
|
68
71
|
def output_ext(ext)
|
@@ -71,13 +74,3 @@ module Bridgetown
|
|
71
74
|
end
|
72
75
|
end
|
73
76
|
end
|
74
|
-
|
75
|
-
Bridgetown::Hooks.register :site, :pre_render, reloadable: false do |site|
|
76
|
-
# make sure Liquid doesn't find {% %} and decide to process Serbea code!
|
77
|
-
site.contents.each do |convertible|
|
78
|
-
convertible.data.render_with_liquid = false if convertible.extname == ".serb"
|
79
|
-
end
|
80
|
-
site.layouts.values.each do |convertible|
|
81
|
-
convertible.data.render_with_liquid = false if convertible.ext == ".serb"
|
82
|
-
end
|
83
|
-
end
|
data/lib/serbea/helpers.rb
CHANGED
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: serbea
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bridgetown Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|