andromeda_cms 0.1.0 → 0.1.2
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 +24 -0
- data/lib/andromeda/entry.rb +26 -3
- data/lib/andromeda/pipeline.rb +6 -2
- data/lib/andromeda/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 662abf6c10c57c55c586ed4251c2c0401ce77cac5f76a0974d4cdce33f1fd62f
|
|
4
|
+
data.tar.gz: dc74176a48e4cc35b04359e81ced65fca9c511239a9d97548243ab260cd961e6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dd1c410bad45f6ab02a83066fabcd7e2d16e7e4e2b1f7875c9744439e787b15a42544b8b755eb59c53365fd8f1d1fb0d0b17dabb6f1089dc513b15d0835f13fb
|
|
7
|
+
data.tar.gz: 9db77b986bacd294a491d76929c213d43591d4926aaaaef96885255dca7b2747fe4f56d23856028917f314cf094f0cd8c9c960ab0cb73fa76ecb979e02ff09c8
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,28 @@ All notable changes to this project are documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.1.2] - 2026-09-27
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- `Entry#body` returned `nil` in production. Entries there are read from the
|
|
13
|
+
built index, which leaves bodies out, so anything using the raw Markdown --
|
|
14
|
+
a reading-time estimate, a Markdown export -- failed with `NoMethodError`.
|
|
15
|
+
The build now stores each entry's body in its own file (not the index), and
|
|
16
|
+
`Entry#body` reads it from there when needed, the same way `html` works.
|
|
17
|
+
Existing builds pick this up on the next `andromeda:build`.
|
|
18
|
+
|
|
19
|
+
## [0.1.1] - 2026-09-27
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- `andromeda:build` failed with `Andromeda::BuildMissing` when run in
|
|
24
|
+
production mode on a clean checkout -- which is exactly how
|
|
25
|
+
`assets:precompile` runs in a Docker build -- because it listed entries from
|
|
26
|
+
the built index instead of the source files. On a production machine that
|
|
27
|
+
already had a build, the same path would have rewritten every page with an
|
|
28
|
+
empty body. Builds now always read the source files.
|
|
29
|
+
|
|
8
30
|
## [0.1.0] - 2026-09-27
|
|
9
31
|
|
|
10
32
|
### Added
|
|
@@ -27,4 +49,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
27
49
|
- Generators: `andromeda:install`, `andromeda:collection`,
|
|
28
50
|
`andromeda:component` and `andromeda:import_astro`.
|
|
29
51
|
|
|
52
|
+
[0.1.2]: https://github.com/AndromedaCMS/andromeda_cms/releases/tag/v0.1.2
|
|
53
|
+
[0.1.1]: https://github.com/AndromedaCMS/andromeda_cms/releases/tag/v0.1.1
|
|
30
54
|
[0.1.0]: https://github.com/AndromedaCMS/andromeda_cms/releases/tag/v0.1.0
|
data/lib/andromeda/entry.rb
CHANGED
|
@@ -154,6 +154,18 @@ module Andromeda
|
|
|
154
154
|
Andromeda::Pipeline.new.collection_index(self)
|
|
155
155
|
end
|
|
156
156
|
|
|
157
|
+
# Every entry read and validated from its source file, whatever the
|
|
158
|
+
# mode. This is what `andromeda:build` converts: in production `all`
|
|
159
|
+
# reads the built index instead, which does not exist before the first
|
|
160
|
+
# build and carries no body after it, so a build that went through `all`
|
|
161
|
+
# would either fail or overwrite every page with empty HTML.
|
|
162
|
+
#
|
|
163
|
+
# @return [Array<Andromeda::Entry>]
|
|
164
|
+
# @raise [Andromeda::LoaderError] listing every file that failed.
|
|
165
|
+
def source_entries
|
|
166
|
+
load_entries_from_source
|
|
167
|
+
end
|
|
168
|
+
|
|
157
169
|
# Drops the in-memory cache, forcing the next query to re-run the
|
|
158
170
|
# Loader. Used by tests that change fixtures mid-example, and is the
|
|
159
171
|
# hook the dev-mode "reconvert on stale mtime" check will call.
|
|
@@ -218,9 +230,6 @@ module Andromeda
|
|
|
218
230
|
# @return [Hash] Symbol-keyed validated frontmatter (may also carry
|
|
219
231
|
# String keys for unrecognized frontmatter -- see Schema::Result).
|
|
220
232
|
attr_reader :data
|
|
221
|
-
# @return [String] raw Markdown/MDX body, frontmatter stripped but with
|
|
222
|
-
# original line numbers preserved (Andromeda::Frontmatter#parse).
|
|
223
|
-
attr_reader :body
|
|
224
233
|
# @return [String] absolute path to the source file.
|
|
225
234
|
attr_reader :file_path
|
|
226
235
|
# @return [String] SHA-256 of the whole source file, for cache keys.
|
|
@@ -250,6 +259,20 @@ module Andromeda
|
|
|
250
259
|
converted[:html]
|
|
251
260
|
end
|
|
252
261
|
|
|
262
|
+
# The raw Markdown/MDX body, frontmatter stripped but with original line
|
|
263
|
+
# numbers preserved (Andromeda::Frontmatter#parse). Entries loaded from
|
|
264
|
+
# source carry it already; in production they come from the index, which
|
|
265
|
+
# leaves bodies out, so it is read from the entry's built file the same
|
|
266
|
+
# way `html` is.
|
|
267
|
+
#
|
|
268
|
+
# @return [String, nil] nil only for a build made before bodies were
|
|
269
|
+
# stored (andromeda_cms < 0.1.2); rebuilding fixes it.
|
|
270
|
+
# @raise [Andromeda::BuildMissing] in production, if this entry has
|
|
271
|
+
# never been built.
|
|
272
|
+
def body
|
|
273
|
+
@body || converted[:body]
|
|
274
|
+
end
|
|
275
|
+
|
|
253
276
|
# @return [Array<Hash>] `{depth:, slug:, text:}` per heading, in
|
|
254
277
|
# document order (Andromeda::Renderer::Result#headings).
|
|
255
278
|
# @raise [Andromeda::BuildMissing] in production, if this entry has
|
data/lib/andromeda/pipeline.rb
CHANGED
|
@@ -49,7 +49,7 @@ module Andromeda
|
|
|
49
49
|
# `data`/`body`/`digest`/`file_path` all come straight from the
|
|
50
50
|
# source file, not from a previous build).
|
|
51
51
|
# @return [Hash] the stored payload (Symbol-keyed: `id`, `collection`,
|
|
52
|
-
# `data`, `html`, `headings`, `digest`, `file_path`).
|
|
52
|
+
# `data`, `html`, `headings`, `body`, `digest`, `file_path`).
|
|
53
53
|
# @raise [Andromeda::SyntaxError, Andromeda::ParserError,
|
|
54
54
|
# Andromeda::Renderer::MissingComponentError] on a bad file; callers
|
|
55
55
|
# that want every problem across a whole collection reported together
|
|
@@ -69,6 +69,10 @@ module Andromeda
|
|
|
69
69
|
data: publish_data_images(entry),
|
|
70
70
|
html: result.html,
|
|
71
71
|
headings: result.headings,
|
|
72
|
+
# Kept so `Entry#body` works in production, where entries come from
|
|
73
|
+
# the index and the source file is never read. The index itself
|
|
74
|
+
# leaves it out (Store#index_summary), so listings stay small.
|
|
75
|
+
body: entry.body,
|
|
72
76
|
digest: entry.digest,
|
|
73
77
|
render_key: render_key,
|
|
74
78
|
file_path: entry.file_path
|
|
@@ -171,7 +175,7 @@ module Andromeda
|
|
|
171
175
|
def build_collection(entry_class)
|
|
172
176
|
entries =
|
|
173
177
|
begin
|
|
174
|
-
entry_class.
|
|
178
|
+
entry_class.source_entries
|
|
175
179
|
rescue Andromeda::LoaderError => e
|
|
176
180
|
return BuildResult.new(
|
|
177
181
|
collection: entry_class.collection_name, converted: 0,
|
data/lib/andromeda/version.rb
CHANGED