lifer 0.3.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +16 -1
- data/Gemfile.lock +7 -7
- data/lib/lifer/builder/html/from_liquid/layout_tag.rb +2 -2
- data/lib/lifer/builder/html/from_liquid/liquid_env.rb +30 -0
- data/lib/lifer/builder/html/from_liquid.rb +3 -10
- data/lib/lifer/version.rb +1 -1
- data/lifer.gemspec +1 -1
- metadata +9 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ce126108ec46665db3ad8337c07db1e11806bbb9792f5a86e5eed169925fe5d
|
4
|
+
data.tar.gz: 90a6531804b57953fbd5da4d5b0488d6b9e98659111d4b5891aabc9907242ff3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d403fab16070747ccf5f5e756d135d0a30ebd955f3115f0cb75a549a61cb6affa8558fe17147a731f7ddee92dcc9484d529246353d0def6979ae7ebf004dd09
|
7
|
+
data.tar.gz: cdbffa546204eea258e2488b765e393490103677d25754d8111b3de52429bf5e0a955f1d76e3034854319deb423befb8031120b8881d7acf9b65db1fd6ec855c
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,22 @@
|
|
1
|
+
## Next
|
2
|
+
|
3
|
+
## v0.4.1
|
4
|
+
|
5
|
+
Resolves a bug where Liquid templates using the `{% layout %}` tag were not able
|
6
|
+
to render partials.
|
7
|
+
|
8
|
+
## v0.4.0
|
9
|
+
|
10
|
+
This release locks the `liquid` dependency to Liquid 5.6 or greater. Liquid 5.6
|
11
|
+
added `Liquid::Environment` for managing document context that was previously
|
12
|
+
stored in `Liquid::Template`, which was global and unsafe. This release ensures
|
13
|
+
that Lifer supports the new `Liquid::Environment` way of handling Liquid's local
|
14
|
+
filesystem for templates and partials.
|
15
|
+
|
1
16
|
## v0.3.0
|
2
17
|
|
3
18
|
This version marks the first version of Lifer that is kind of usable. The README
|
4
|
-
currently describes the big picture best. But I can that as of this version,
|
19
|
+
currently describes the big picture best. But I can add that, as of this version,
|
5
20
|
I've documented all of the public interfaces and added a good number of `FIXME`
|
6
21
|
comments to indicate functionality that _works_ but isn't quite where I want it
|
7
22
|
to be long term.
|
data/Gemfile.lock
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
lifer (0.
|
4
|
+
lifer (0.4.1)
|
5
5
|
i18n (< 2)
|
6
6
|
kramdown (~> 2.4)
|
7
|
-
liquid (< 6)
|
7
|
+
liquid (~> 5.6, < 6)
|
8
8
|
listen (< 4)
|
9
9
|
puma (< 7)
|
10
10
|
rack (< 4)
|
@@ -26,7 +26,7 @@ GEM
|
|
26
26
|
rack-test (>= 0.6.3)
|
27
27
|
regexp_parser (>= 1.5, < 3.0)
|
28
28
|
xpath (~> 3.2)
|
29
|
-
concurrent-ruby (1.3.
|
29
|
+
concurrent-ruby (1.3.5)
|
30
30
|
debug (1.9.2)
|
31
31
|
irb (~> 1.10)
|
32
32
|
reline (>= 0.3.8)
|
@@ -34,7 +34,7 @@ GEM
|
|
34
34
|
ffi (1.17.1-arm64-darwin)
|
35
35
|
ffi (1.17.1-x86_64-darwin)
|
36
36
|
ffi (1.17.1-x86_64-linux-gnu)
|
37
|
-
i18n (1.14.
|
37
|
+
i18n (1.14.7)
|
38
38
|
concurrent-ruby (~> 1.0)
|
39
39
|
io-console (0.7.2)
|
40
40
|
irb (1.14.0)
|
@@ -43,9 +43,9 @@ GEM
|
|
43
43
|
kramdown (2.5.1)
|
44
44
|
rexml (>= 3.3.9)
|
45
45
|
language_server-protocol (3.17.0.3)
|
46
|
-
liquid (5.
|
46
|
+
liquid (5.7.2)
|
47
47
|
bigdecimal
|
48
|
-
strscan
|
48
|
+
strscan (>= 3.1.1)
|
49
49
|
listen (3.9.0)
|
50
50
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
51
51
|
rb-inotify (~> 0.9, >= 0.9.10)
|
@@ -66,7 +66,7 @@ GEM
|
|
66
66
|
psych (5.1.2)
|
67
67
|
stringio
|
68
68
|
public_suffix (6.0.1)
|
69
|
-
puma (6.
|
69
|
+
puma (6.6.0)
|
70
70
|
nio4r (~> 2.0)
|
71
71
|
racc (1.8.1)
|
72
72
|
rack (3.1.7)
|
@@ -50,8 +50,8 @@ class Lifer::Builder::HTML::FromLiquid
|
|
50
50
|
.gsub(/\{%\s*#{tag_name}.+%\}/, "")
|
51
51
|
|
52
52
|
content_with_layout = Liquid::Template
|
53
|
-
.parse(current_layout_file,
|
54
|
-
.render(document_context, render_options)
|
53
|
+
.parse(current_layout_file, **parse_options)
|
54
|
+
.render(document_context, **render_options)
|
55
55
|
|
56
56
|
Liquid::Template
|
57
57
|
.parse(
|
@@ -0,0 +1,30 @@
|
|
1
|
+
class Lifer::Builder::HTML::FromLiquid
|
2
|
+
# From the `liquid` gem's README:
|
3
|
+
#
|
4
|
+
# "In Liquid, a "Environment" is a scoped environment that encapsulates
|
5
|
+
# custom tags, filters, and other configurations. This allows you to
|
6
|
+
# define and isolate different sets of functionality for different
|
7
|
+
# contexts, avoiding global overrides that can lead to conflicts
|
8
|
+
# and unexpected behavior."
|
9
|
+
#
|
10
|
+
# For Lifer, we simply use a single global environment for each build.
|
11
|
+
#
|
12
|
+
class LiquidEnv
|
13
|
+
# Returns the global Liquid environment that contains all local
|
14
|
+
# templates, custom tags, and filters.
|
15
|
+
#
|
16
|
+
# @return [Lifer::Environment]
|
17
|
+
def self.global
|
18
|
+
Liquid::Environment.build do |environment|
|
19
|
+
environment.error_mode = :strict
|
20
|
+
|
21
|
+
environment.file_system =
|
22
|
+
Liquid::LocalFileSystem.new(Lifer.root, "%s.html.liquid")
|
23
|
+
|
24
|
+
environment.register_filter Lifer::Builder::HTML::FromLiquid::Filters
|
25
|
+
environment.register_tag "layout",
|
26
|
+
Lifer::Builder::HTML::FromLiquid::LayoutTag
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -3,6 +3,8 @@ require "liquid"
|
|
3
3
|
require_relative "from_liquid/drops"
|
4
4
|
require_relative "from_liquid/filters"
|
5
5
|
require_relative "from_liquid/layout_tag"
|
6
|
+
require_relative "from_liquid/liquid_env"
|
7
|
+
|
6
8
|
|
7
9
|
class Lifer::Builder::HTML
|
8
10
|
# If the HTML builder is given a Liquid template, it uses this class to parse
|
@@ -88,16 +90,7 @@ class Lifer::Builder::HTML
|
|
88
90
|
contents + "\n{% #{LayoutTag::ENDNAME} %}"
|
89
91
|
end
|
90
92
|
|
91
|
-
def liquid_environment
|
92
|
-
@liquid_environment ||= Liquid::Environment.build do |environment|
|
93
|
-
environment.file_system =
|
94
|
-
Liquid::LocalFileSystem.new(Lifer.root, "%s.html.liquid")
|
95
|
-
|
96
|
-
environment.register_filter Lifer::Builder::HTML::FromLiquid::Filters
|
97
|
-
environment.register_tag "layout",
|
98
|
-
Lifer::Builder::HTML::FromLiquid::LayoutTag
|
99
|
-
end
|
100
|
-
end
|
93
|
+
def liquid_environment = (@liquid_environment ||= LiquidEnv.global)
|
101
94
|
|
102
95
|
def parse_options
|
103
96
|
{
|
data/lib/lifer/version.rb
CHANGED
data/lifer.gemspec
CHANGED
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
|
|
35
35
|
|
36
36
|
spec.add_dependency "i18n", "< 2"
|
37
37
|
spec.add_dependency "kramdown", "~> 2.4"
|
38
|
-
spec.add_dependency "liquid", "< 6"
|
38
|
+
spec.add_dependency "liquid", ["~> 5.6", "< 6"]
|
39
39
|
spec.add_dependency "listen", "< 4"
|
40
40
|
spec.add_dependency "puma", "< 7"
|
41
41
|
spec.add_dependency "rack", "< 4"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lifer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- benjamin wil
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|
@@ -42,6 +42,9 @@ dependencies:
|
|
42
42
|
name: liquid
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '5.6'
|
45
48
|
- - "<"
|
46
49
|
- !ruby/object:Gem::Version
|
47
50
|
version: '6'
|
@@ -49,6 +52,9 @@ dependencies:
|
|
49
52
|
prerelease: false
|
50
53
|
version_requirements: !ruby/object:Gem::Requirement
|
51
54
|
requirements:
|
55
|
+
- - "~>"
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '5.6'
|
52
58
|
- - "<"
|
53
59
|
- !ruby/object:Gem::Version
|
54
60
|
version: '6'
|
@@ -171,6 +177,7 @@ files:
|
|
171
177
|
- lib/lifer/builder/html/from_liquid/drops/settings_drop.rb
|
172
178
|
- lib/lifer/builder/html/from_liquid/filters.rb
|
173
179
|
- lib/lifer/builder/html/from_liquid/layout_tag.rb
|
180
|
+
- lib/lifer/builder/html/from_liquid/liquid_env.rb
|
174
181
|
- lib/lifer/builder/rss.rb
|
175
182
|
- lib/lifer/builder/txt.rb
|
176
183
|
- lib/lifer/cli.rb
|