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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c5b809ec2d2de960b954c9d12d4bdfaaf1f910ff1f1e5aa7ac217db968cd1ac7
4
- data.tar.gz: e819b84c2c0a33767f4d3736de70e916bfdd41fe354ba89a9f551172b22bdb41
3
+ metadata.gz: 002caf1e91a373f0b94de2cfca37145b80d725205296623276e0693aed768953
4
+ data.tar.gz: 0b27aa02debeb406fc4896fb497367accbe19250f9fb5d5f022ff256af538da5
5
5
  SHA512:
6
- metadata.gz: 71b3ab77eed51511959586f271ff814e094c6ef4fb4278dc60d85b92dafec4a328a084e27359c7626b661dea18e4e4f6007bceb40b4780557e1454752ed95d27
7
- data.tar.gz: ff277d2b7471f668586248e0524429c8380ca30322f5b698bdf44b094a4cd7a202dfdfd3a87a7d1de3b652140eaf5d9e285f1addeb632e79e4be96b83e2e415b
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 application, Bridgetown static sites, or pretty much any Ruby scenario you could imagine.
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 = nil)
57
- if convertible
58
- if convertible.data[:template_engine] == "serbea" ||
59
- (convertible.data[:template_engine].nil? &&
60
- @config[:template_engine] == "serbea")
61
- return true
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
@@ -22,7 +22,7 @@ module Serbea
22
22
  @_erbout = previous_buffer_state
23
23
  @output_buffer = previous_ob_state
24
24
 
25
- result.html_safe
25
+ result&.html_safe
26
26
  end
27
27
 
28
28
  def pipeline(context, value)
@@ -1,3 +1,3 @@
1
1
  module Serbea
2
- VERSION = "0.7.1"
2
+ VERSION = "0.7.2"
3
3
  end
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.1
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-01 00:00:00.000000000 Z
11
+ date: 2020-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake