andromeda_cms 0.4.1-aarch64-linux → 0.5.0-aarch64-linux
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/README.md +4 -0
- data/lib/andromeda/entry.rb +30 -3
- data/lib/andromeda/helpers.rb +8 -3
- data/lib/andromeda/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: e64f4dc8a464812ca4fbd50f7ffc1a15609623471dd1a643a2a5b7ce2437a731
|
|
4
|
+
data.tar.gz: e0e688fa71f11e8e214ab087753dc52806af908808c03b268593247cecc91f25
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1563ed9bf6fba82b6e8222af0b766a14322afddb17dffeb99e129a556b74319b4498e7aac657535e2500eee149cb7621293eb3e8ec1a1131b6c0df549c174fdf
|
|
7
|
+
data.tar.gz: ed53c666b48a20394b15b1c25ef0468c26af275e4f23dac957b38f32672c61c99394fcb71ccb491e3afc5ca25fa6d7c81285503b6dce3a7aef9961b383880768
|
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.5.0] - 2026-10-07
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- `andromeda_content` now wraps the entry body in an `<andromeda-content>`
|
|
13
|
+
element, so the body can be targeted from CSS. Browsers treat an unknown
|
|
14
|
+
element as inline, so add `andromeda-content { display: block; }` to your
|
|
15
|
+
stylesheet. Markup that selected the body's direct children from the
|
|
16
|
+
parent element needs updating. Inside a component rendered during
|
|
17
|
+
`andromeda:build` the wrapper is left out, so an embedded entry is not
|
|
18
|
+
wrapped twice.
|
|
19
|
+
|
|
20
|
+
## [0.4.2] - 2026-09-30
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- In development, a file added or edited under `app/content/` now shows up
|
|
25
|
+
without restarting the server. `Entry` used to keep the list it loaded
|
|
26
|
+
first, so a new file returned 404 and an edited one kept its old content.
|
|
27
|
+
The list is now reloaded when the paths, mtimes or sizes of the collection's
|
|
28
|
+
source files change; production is unchanged.
|
|
29
|
+
|
|
8
30
|
## [0.4.1] - 2026-09-29
|
|
9
31
|
|
|
10
32
|
### Fixed
|
|
@@ -131,6 +153,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
131
153
|
- Generators: `andromeda:install`, `andromeda:collection`,
|
|
132
154
|
`andromeda:component` and `andromeda:import_astro`.
|
|
133
155
|
|
|
156
|
+
[0.5.0]: https://github.com/AndromedaCMS/andromeda_cms/releases/tag/v0.5.0
|
|
157
|
+
[0.4.2]: https://github.com/AndromedaCMS/andromeda_cms/releases/tag/v0.4.2
|
|
134
158
|
[0.4.1]: https://github.com/AndromedaCMS/andromeda_cms/releases/tag/v0.4.1
|
|
135
159
|
[0.4.0]: https://github.com/AndromedaCMS/andromeda_cms/releases/tag/v0.4.0
|
|
136
160
|
[0.3.0]: https://github.com/AndromedaCMS/andromeda_cms/releases/tag/v0.3.0
|
data/README.md
CHANGED
|
@@ -107,6 +107,10 @@ end
|
|
|
107
107
|
</article>
|
|
108
108
|
```
|
|
109
109
|
|
|
110
|
+
`andromeda_content` wraps the body in an `<andromeda-content>` element. Browsers
|
|
111
|
+
treat it as inline by default, so add `andromeda-content { display: block; }`
|
|
112
|
+
to your stylesheet.
|
|
113
|
+
|
|
110
114
|
From there it is your code. A typical next step is to make fields mandatory,
|
|
111
115
|
add a draft flag, and add a table of contents:
|
|
112
116
|
|
data/lib/andromeda/entry.rb
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require "digest"
|
|
3
4
|
require "pathname"
|
|
4
5
|
|
|
5
6
|
module Andromeda
|
|
@@ -45,6 +46,7 @@ module Andromeda
|
|
|
45
46
|
@base_dir = resolve_base(base)
|
|
46
47
|
@pattern = pattern
|
|
47
48
|
@entries = nil
|
|
49
|
+
@entries_signature = nil
|
|
48
50
|
Andromeda::Registry.register(@collection_name, self)
|
|
49
51
|
self
|
|
50
52
|
end
|
|
@@ -174,10 +176,12 @@ module Andromeda
|
|
|
174
176
|
end
|
|
175
177
|
|
|
176
178
|
# Drops the in-memory cache, forcing the next query to re-run the
|
|
177
|
-
# Loader. Used by tests that change fixtures mid-example
|
|
178
|
-
#
|
|
179
|
+
# Loader. Used by tests that change fixtures mid-example and by
|
|
180
|
+
# Andromeda::Check; development queries notice source changes on their
|
|
181
|
+
# own (see `entries`).
|
|
179
182
|
def reload!
|
|
180
183
|
@entries = nil
|
|
184
|
+
@entries_signature = nil
|
|
181
185
|
end
|
|
182
186
|
|
|
183
187
|
private
|
|
@@ -190,10 +194,33 @@ module Andromeda
|
|
|
190
194
|
# the index is only rewritten once a collection finishes converting,
|
|
191
195
|
# so a component querying entries mid-build reads source instead
|
|
192
196
|
# (see Andromeda::BuildContext).
|
|
197
|
+
#
|
|
198
|
+
# The development cache is dropped whenever the source files change
|
|
199
|
+
# (see `source_signature`), so a file added or edited while the server
|
|
200
|
+
# runs shows up on the next query without a restart.
|
|
193
201
|
def entries
|
|
194
202
|
return source_entries if Andromeda::BuildContext.building?
|
|
203
|
+
return @entries ||= entries_from_index if production?
|
|
204
|
+
|
|
205
|
+
signature = source_signature
|
|
206
|
+
if @entries.nil? || signature != @entries_signature
|
|
207
|
+
@entries = load_entries_from_source
|
|
208
|
+
@entries_signature = signature
|
|
209
|
+
end
|
|
210
|
+
@entries
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
# Paths, mtimes and sizes of the collection's source files: an added or
|
|
214
|
+
# removed file changes the path list, an edit changes mtime/size. Same
|
|
215
|
+
# scheme as Andromeda::Pipeline#render_key uses for component partials.
|
|
216
|
+
def source_signature
|
|
217
|
+
files = Dir.glob(pattern, base: base_dir).sort.filter_map do |relative|
|
|
218
|
+
file = File.join(base_dir, relative)
|
|
219
|
+
next unless File.file?(file)
|
|
195
220
|
|
|
196
|
-
|
|
221
|
+
[relative, File.mtime(file).to_r, File.size(file)].join(":")
|
|
222
|
+
end
|
|
223
|
+
Digest::SHA256.hexdigest(files.join("\n"))
|
|
197
224
|
end
|
|
198
225
|
|
|
199
226
|
def production?
|
data/lib/andromeda/helpers.rb
CHANGED
|
@@ -5,7 +5,11 @@ module Andromeda
|
|
|
5
5
|
# thin presentation layer over data the build already produced: no parsing
|
|
6
6
|
# or rendering happens while serving a request.
|
|
7
7
|
module Helpers
|
|
8
|
-
# Outputs an entry's converted body
|
|
8
|
+
# Outputs an entry's converted body, wrapped in `<andromeda-content>` so
|
|
9
|
+
# it can be targeted from CSS. Inside a component rendered at conversion
|
|
10
|
+
# time the wrapper is left out: the component's output is stored in the
|
|
11
|
+
# entry's html and wrapped once, when the page is served. Marked
|
|
12
|
+
# html_safe because the build
|
|
9
13
|
# produced this markup from content the application's own authors wrote,
|
|
10
14
|
# the same trust model Astro applies to `.md`/`.mdx` (see 13_security).
|
|
11
15
|
# Inside a component rendered at conversion time the asset markers are
|
|
@@ -14,8 +18,9 @@ module Andromeda
|
|
|
14
18
|
# @param entry [Andromeda::Entry]
|
|
15
19
|
# @return [ActiveSupport::SafeBuffer]
|
|
16
20
|
def andromeda_content(entry)
|
|
17
|
-
html
|
|
18
|
-
|
|
21
|
+
return entry.html.html_safe if Andromeda::BuildContext.converting? # rubocop:disable Rails/OutputSafety
|
|
22
|
+
|
|
23
|
+
tag.send("andromeda-content", Andromeda::Assets.resolve(entry.html).html_safe) # rubocop:disable Rails/OutputSafety
|
|
19
24
|
end
|
|
20
25
|
|
|
21
26
|
# Inside a component partial rendered at conversion time, this returns
|
data/lib/andromeda/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: andromeda_cms
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.5.0
|
|
5
5
|
platform: aarch64-linux
|
|
6
6
|
authors:
|
|
7
7
|
- LIMHAUS Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-10-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: railties
|