host: cards-as-types — the blog content block vocabulary as metamodel types
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 50s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 50s
Seed the kg-card / content-on-sx block kinds as types: a 'card' root (subtype-of type) + card-heading/text/image/quote/code/embed/callout as subtypes, each with its own fields (host/blog--seed-card-type!). They appear in /meta (Types 11) and define (a) the editor's future card palette and (b) the radar migrator's target vocabulary. Instances-as-blocks vs instances-as-posts is a later decision — this is the vocabulary. plans/NOTE-blog-types-for-radar.md: the TYPE CONTRACT for the loops/radar migration — a blog post -> is-a article + typed field-values; body Ghost/Koenig cards -> these card-types. Two paths mapped onto radar's duplicate->cutover->diverge (type-at-import vs type-in-diverge), plus the open cards-as-blocks-vs-posts question for them to inform from the Ghost corpus. Verified live-path (/meta Types 11, card-types with fields) + focused eval (type-defs has card-image; fields src/alt/caption, heading level/text). Full blog conformance still blocked by box contention; test added for a quiet re-run. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -703,6 +703,19 @@
|
||||
"application/x-www-form-urlencoded" "title=Sneaky Rel"))
|
||||
(host/blog-exists? "sneaky-rel"))
|
||||
false)
|
||||
|
||||
;; -- cards-as-types: the blog content block vocabulary --
|
||||
(host-bl-test "card-types are seeded as subtypes of card (in type-defs)"
|
||||
(let ((defs (host/blog-type-defs)))
|
||||
(list (contains? defs "card") (contains? defs "card-image") (contains? defs "card-heading")))
|
||||
(list true true true))
|
||||
(host-bl-test "a card-type carries its fields"
|
||||
(map (fn (f) (get f :name)) (host/blog-fields-of "card-image"))
|
||||
(list "src" "alt" "caption"))
|
||||
(host-bl-test "/meta lists the card vocabulary with fields"
|
||||
(let ((body (dream-resp-body (host-bl-app (host-bl-req "/meta")))))
|
||||
(list (contains? body ">Image</a>") (contains? body "src:URL, alt:String")))
|
||||
(list true true))
|
||||
(host-bl-test "a post with no schema'd type is vacuously valid"
|
||||
(host/blog-type-valid? "ppost" "(p \"anything\")") true)
|
||||
(host-bl-test "edit-submit rejects content violating the type schema (not saved)"
|
||||
|
||||
Reference in New Issue
Block a user