lifer 0.14.0 → 0.15.1
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/CHANGELOG.md +26 -0
- data/Gemfile.lock +1 -1
- data/lib/lifer/builder/html/from_any.rb +8 -0
- data/lib/lifer/builder/html/from_liquid/liquid_env.rb +1 -1
- data/lib/lifer/builder/html/from_liquid.rb +2 -2
- data/lib/lifer/builder/json_feed.rb +1 -1
- data/lib/lifer/builder/rss.rb +1 -1
- data/lib/lifer/cli.rb +5 -0
- data/lib/lifer/entry.rb +6 -0
- data/lib/lifer/version.rb +1 -1
- data/lib/lifer.rb +1 -0
- data/locales/en.yml +2 -0
- 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: 77ae4b570449457ff719f5376089d578acd28e3cdd9e488c01b4948e94c7cc37
|
|
4
|
+
data.tar.gz: f016806b8615fd54792ea974eedba56988a5ec45cfdb3874370f9dade6b4e0b7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 75781a84cac83ab375a2e899ec0d9dc9dc1299308638a2afa546eb534570b8529713145dd64516d336fce7e28f6447084b31a689e5334ee8bc891c83d99608d1
|
|
7
|
+
data.tar.gz: f010be935ca56e945895ca9eb4441b30f944cd56a32b278c1cef2d0b854822b9d4cfed18f3745b4e4f191e6fa1d90ec79f2b9cd9c48949daea403d554ac97d4a
|
data/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,30 @@
|
|
|
1
1
|
## Next
|
|
2
|
+
## v0.15.1
|
|
3
|
+
|
|
4
|
+
In this release:
|
|
5
|
+
|
|
6
|
+
- Entry IDs and permalinks are no longer equivalent. This helps us build out
|
|
7
|
+
entries (or something with the same interface as entries) that aren't
|
|
8
|
+
represented by a file on disk.
|
|
9
|
+
- The `node_modules` directory is now ignored at build time.
|
|
10
|
+
|
|
11
|
+
## v0.15.0
|
|
12
|
+
|
|
13
|
+
The theme for this release is improved error messaging
|
|
14
|
+
|
|
15
|
+
- If the project root is equal to the `Lifer.gem_root`, we now exit before
|
|
16
|
+
attempting to build. This is just a quality-of-life improvement for
|
|
17
|
+
developers, to ensure that the project and Lifer development environment
|
|
18
|
+
are isolated from each other.
|
|
19
|
+
- When building HTML from Liquid templates, we now use the `:strict2`
|
|
20
|
+
error mode and the error-raising `#render!` method for Liquid documents
|
|
21
|
+
now. This results in build failing early rather than Liquid builds succeeding
|
|
22
|
+
with entry contents that include strings like "Liquid error: blah blah."
|
|
23
|
+
- When any entry fails to build for some reason, we now rescue the error,
|
|
24
|
+
inject an error message and entry context into STDOUT, and then re-raise
|
|
25
|
+
the original error. This should improve the experience of debugging template
|
|
26
|
+
bugs in projects.
|
|
27
|
+
|
|
2
28
|
## v0.14.0
|
|
3
29
|
|
|
4
30
|
This release includes some really nice improvements and bug fixes:
|
data/Gemfile.lock
CHANGED
|
@@ -11,6 +11,14 @@ class Lifer::Builder
|
|
|
11
11
|
# @return [String] The rendered entry.
|
|
12
12
|
def build(entry:)
|
|
13
13
|
new(entry: entry).build
|
|
14
|
+
rescue => error
|
|
15
|
+
Lifer::Message.error "builder.catchall_failure", context: {
|
|
16
|
+
entry_path: entry.path,
|
|
17
|
+
collection: entry.collection,
|
|
18
|
+
layout_file: entry.collection&.layout_file,
|
|
19
|
+
error_message: error.message
|
|
20
|
+
}.to_json
|
|
21
|
+
raise(error)
|
|
14
22
|
end
|
|
15
23
|
end
|
|
16
24
|
|
|
@@ -16,7 +16,7 @@ class Lifer::Builder::HTML::FromLiquid
|
|
|
16
16
|
# @return [Lifer::Environment]
|
|
17
17
|
def self.global
|
|
18
18
|
Liquid::Environment.build do |environment|
|
|
19
|
-
environment.error_mode = :
|
|
19
|
+
environment.error_mode = :strict2
|
|
20
20
|
|
|
21
21
|
environment.file_system =
|
|
22
22
|
Liquid::LocalFileSystem.new(Lifer.root, "%s.html.liquid")
|
|
@@ -40,7 +40,7 @@ class Lifer::Builder::HTML
|
|
|
40
40
|
)
|
|
41
41
|
document = Liquid::Template
|
|
42
42
|
.parse(layout_file_contents, **parse_options)
|
|
43
|
-
.render(document_context, **render_options)
|
|
43
|
+
.render!(document_context, **render_options)
|
|
44
44
|
|
|
45
45
|
return document unless (relative_layout_path = frontmatter[:layout])
|
|
46
46
|
|
|
@@ -83,7 +83,7 @@ class Lifer::Builder::HTML
|
|
|
83
83
|
def parse_options
|
|
84
84
|
{
|
|
85
85
|
environment: liquid_environment,
|
|
86
|
-
error_mode: :
|
|
86
|
+
error_mode: :strict2
|
|
87
87
|
}
|
|
88
88
|
end
|
|
89
89
|
|
|
@@ -117,7 +117,7 @@ class Lifer::Builder
|
|
|
117
117
|
# by the end of this procedure.
|
|
118
118
|
def json_feed_entry(feed_object, lifer_entry, lifer_collection)
|
|
119
119
|
feed_item_object = {
|
|
120
|
-
id: lifer_entry.
|
|
120
|
+
id: lifer_entry.identifier,
|
|
121
121
|
url: lifer_entry.permalink,
|
|
122
122
|
external_url: lifer_entry.frontmatter[:external_url],
|
|
123
123
|
title: lifer_entry.title,
|
data/lib/lifer/builder/rss.rb
CHANGED
|
@@ -216,7 +216,7 @@ class Lifer::Builder::RSS < Lifer::Builder
|
|
|
216
216
|
if (authors = lifer_entry.authors).any?
|
|
217
217
|
rss_feed_item.author = authors.join(", ")
|
|
218
218
|
end
|
|
219
|
-
rss_feed_item.id = lifer_entry.
|
|
219
|
+
rss_feed_item.id = lifer_entry.identifier
|
|
220
220
|
rss_feed_item.link = lifer_entry.permalink
|
|
221
221
|
rss_feed_item.title = lifer_entry.title
|
|
222
222
|
rss_feed_item.summary = lifer_entry.summary
|
data/lib/lifer/cli.rb
CHANGED
|
@@ -66,6 +66,11 @@ module Lifer
|
|
|
66
66
|
parser.parse! args
|
|
67
67
|
|
|
68
68
|
brain = Lifer.brain(**{root: @root, config_file: @config_file}.compact)
|
|
69
|
+
if brain.root == Lifer.gem_root
|
|
70
|
+
Lifer::Message.error("cli.pwd_is_gem_root", root: brain.root)
|
|
71
|
+
return
|
|
72
|
+
end
|
|
73
|
+
|
|
69
74
|
brain.require_user_provided_ruby_files!
|
|
70
75
|
|
|
71
76
|
case subcommand
|
data/lib/lifer/entry.rb
CHANGED
|
@@ -205,6 +205,12 @@ module Lifer
|
|
|
205
205
|
@full_text ||= File.readlines(file).join if file
|
|
206
206
|
end
|
|
207
207
|
|
|
208
|
+
# A unique identifier for the current entry. For all entry types (so far)
|
|
209
|
+
# it makes sense to use the permalink.
|
|
210
|
+
#
|
|
211
|
+
# @return [String] The permalink (using the defafult global host argument).
|
|
212
|
+
def identifier = permalink
|
|
213
|
+
|
|
208
214
|
# The file extension to be used when at the entry's build time. For
|
|
209
215
|
# example, a Markdown file should be built to HTML.
|
|
210
216
|
#
|
data/lib/lifer/version.rb
CHANGED
data/lib/lifer.rb
CHANGED
data/locales/en.yml
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
en:
|
|
2
2
|
builder:
|
|
3
|
+
catchall_failure: "Something failed during the build! Context:\n%{context}."
|
|
3
4
|
file_conflict_error: "Cannot build HTML file because `%{path}` already exists."
|
|
4
5
|
prebuild_failure: >
|
|
5
6
|
Lifer failed to complete building... A prebuild step failed to execute: %{exception}
|
|
@@ -21,6 +22,7 @@ en:
|
|
|
21
22
|
dump_default_config: Print the default configuration file to STDOUT and exit.
|
|
22
23
|
port: Specify a custom port for the dev server.
|
|
23
24
|
root: Specify the path to the Lifer project root.
|
|
25
|
+
pwd_is_gem_root: "Cannot build project at gem root: %{root}."
|
|
24
26
|
subcommands:
|
|
25
27
|
build: Build the Lifer project as configured in your Lifer configuration file.
|
|
26
28
|
help: Display help text for the Lifer commandline interface.
|
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.15.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: 2026-
|
|
11
|
+
date: 2026-08-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: base64
|
|
@@ -229,8 +229,8 @@ licenses:
|
|
|
229
229
|
- MIT
|
|
230
230
|
metadata:
|
|
231
231
|
allowed_push_host: https://rubygems.org
|
|
232
|
-
homepage_uri: https://github.com/benjaminwil/lifer/blob/v0.
|
|
233
|
-
source_code_uri: https://github.com/benjaminwil/lifer/tree/v0.
|
|
232
|
+
homepage_uri: https://github.com/benjaminwil/lifer/blob/v0.15.1/README.md
|
|
233
|
+
source_code_uri: https://github.com/benjaminwil/lifer/tree/v0.15.1
|
|
234
234
|
changelog_uri: https://github.com/benjaminwil/lifer/blob/main/CHANGELOG.md
|
|
235
235
|
post_install_message:
|
|
236
236
|
rdoc_options: []
|