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:
@@ -584,6 +584,20 @@
|
||||
:rel {:symmetric symmetric :label label :inverse-label inverse-label}}))
|
||||
(host/blog-relate! slug "relation" "is-a"))))
|
||||
|
||||
;; ── cards-as-types (the blog content vocabulary) ────────────────────
|
||||
;; Seed a card-type: a type-post subtype-of "card" with its own fields. The kg-card /
|
||||
;; content-on-sx block vocabulary becomes the metamodel's card types, so the editor's
|
||||
;; card palette + a post's body blocks are driven by type definitions, and the radar
|
||||
;; migrator (plans/NOTE-blog-types-for-radar.md) maps old Ghost cards onto these.
|
||||
(define host/blog--seed-card-type!
|
||||
(fn (slug title fields)
|
||||
(begin
|
||||
(host/blog-seed! slug title
|
||||
(str "(article (h1 \"" title "\") (p \"A " title " card — a kind of content block. Its fields define what the editor collects and the template renders.\"))")
|
||||
"published")
|
||||
(host/blog-relate! slug "card" "subtype-of")
|
||||
(host/blog--set-fields! slug fields))))
|
||||
|
||||
;; Seed the root type-posts: "type" (the root) and "tag" (a kind of type). Types
|
||||
;; ARE posts, so these are real posts that document themselves; tag subtype-of
|
||||
;; type means anything that is-a tag is, transitively, a type. Idempotent — safe
|
||||
@@ -624,6 +638,29 @@
|
||||
;; above the body. (field "subtitle") resolves to the instance's value at render.
|
||||
(host/blog--set-template! "article"
|
||||
"(p :style \"font-style:italic;color:#555;margin:0 0 1em;font-size:1.1em\" (field \"subtitle\"))")
|
||||
;; ── cards-as-types: the blog content block vocabulary (kg-cards / content-on-sx
|
||||
;; block kinds) as metamodel types. "card" is the root; each card kind is a subtype
|
||||
;; with its own fields. These define the editor's card palette + the radar migrator's
|
||||
;; target vocabulary (plans/NOTE-blog-types-for-radar.md). Instances-as-blocks vs
|
||||
;; instances-as-posts is a later decision; this is the vocabulary.
|
||||
(host/blog-seed! "card" "Card"
|
||||
"(article (h1 \"Card\") (p \"A content block — the building unit of a post body. Each card kind is a type with its own fields; the editor collects them and the template renders them.\"))"
|
||||
"published")
|
||||
(host/blog-relate! "card" "type" "subtype-of")
|
||||
(host/blog--seed-card-type! "card-heading" "Heading"
|
||||
(list {:name "level" :type "Int"} {:name "text" :type "String"}))
|
||||
(host/blog--seed-card-type! "card-text" "Text"
|
||||
(list {:name "text" :type "Text"}))
|
||||
(host/blog--seed-card-type! "card-image" "Image"
|
||||
(list {:name "src" :type "URL"} {:name "alt" :type "String"} {:name "caption" :type "String"}))
|
||||
(host/blog--seed-card-type! "card-quote" "Quote"
|
||||
(list {:name "text" :type "Text"} {:name "cite" :type "String"}))
|
||||
(host/blog--seed-card-type! "card-code" "Code"
|
||||
(list {:name "language" :type "String"} {:name "code" :type "Text"}))
|
||||
(host/blog--seed-card-type! "card-embed" "Embed"
|
||||
(list {:name "url" :type "URL"} {:name "caption" :type "String"}))
|
||||
(host/blog--seed-card-type! "card-callout" "Callout"
|
||||
(list {:name "style" :type "String"} {:name "text" :type "Text"}))
|
||||
;; relation DECLARATIONS (see plans/relations-as-posts.md). A type-post declares
|
||||
;; which relation it anchors at its OBJECT end ("you may point at me with R"); the
|
||||
;; picker's candidate set is the down-closure of a relation's anchors through the
|
||||
|
||||
Reference in New Issue
Block a user