@luhtech/site-template 0.3.5 → 0.4.0

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.
package/README.md CHANGED
@@ -116,6 +116,34 @@ the real schema-registry source, not fabricated) only for this one schema,
116
116
  and logs a warning when it does. Every other schema fetch failure is a hard
117
117
  error.
118
118
 
119
+ ## Article sections, table of contents, linkable blocks
120
+
121
+ Added in 0.4.0 (d-2026-09-08-sr-article-venture-site-bridge), the schema-first
122
+ foundation for bridging business-tools' real article pipeline into a
123
+ venture's own marketing site instead of only dash.luh.tech's bare preview:
124
+
125
+ - `sectionKind: "article"` (`sections/Article.astro`) renders a long-form
126
+ article body -- a real, distinct kind from `proof`/`approach`/etc., since
127
+ none of the existing ten fit an article's own reading experience.
128
+ - `block.blockType` gained `stat` (a styled illustrative/rhetorical
129
+ callout -- never a citable fact; a real sourced number is always a
130
+ section-level `figures[]` entry) and `close` (a marked concluding
131
+ paragraph, styled with a top rule).
132
+ - `block.href` (optional, same shape as `cta.href`) makes any individual
133
+ block a real link -- an `audiences` card pointing at a market-specific
134
+ page, or a `list`/`definition` entry pointing at an article's own page.
135
+ `Block.astro` wraps whatever the blockType already renders in an outer
136
+ `<a>`, so link behavior is uniform across every blockType.
137
+ - `TableOfContents.astro` (new, generic component): derives a real jump-list
138
+ from `page.sections[].heading`, linking each entry to that section's own
139
+ `id={section.sectionId}` (every `sections/*.astro` component already
140
+ stamps this). Renders nothing for a page with 0-1 headinged sections --
141
+ a one-entry TOC is noise, not navigation. Does not attempt to derive
142
+ sub-headings from inside a single article section's `blocks[]` -- the
143
+ article chunk vocabulary (lede/section/pullquote/stat/close) has no
144
+ heading-level chunk, so there is nothing real to link to below
145
+ section-level today.
146
+
119
147
  ## Migrating a venture site
120
148
 
121
149
  A migration is: author `content/site.<venture>.json` + `content/pages/*.json`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luhtech/site-template",
3
- "version": "0.3.5",
3
+ "version": "0.4.0",
4
4
  "description": "Shared Astro component library + content-instance contract for LuhTech venture marketing sites -- one template renders every site from content/page.schema.json + content/site.schema.json instances.",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -3,13 +3,31 @@
3
3
  // per the schema's own description -- kept as plain text here (no markdown
4
4
  // parser dependency); a consumer site that needs real markdown rendering
5
5
  // wraps this or replaces it, the contract only requires blockType/text/label.
6
+ //
7
+ // stat/close added in page.schema.json v1.1.0 (d-2026-09-08-sr-article-
8
+ // venture-site-bridge): stat is a styled illustrative/rhetorical callout
9
+ // the piece itself asserts -- never a citable fact (a real sourced number
10
+ // is always a section-level figures[] entry, which carries required
11
+ // public provenance; this block carries none). close is a marked
12
+ // concluding paragraph, same semantics as paragraph, styled with a top
13
+ // rule to read as the piece's final beat.
14
+ //
15
+ // href (also v1.1.0) makes the whole rendered block a real link -- an
16
+ // audiences-section card pointing at a market-specific page, or an
17
+ // article-list entry pointing at that article's own page. Wraps
18
+ // whatever the blockType already renders in an outer <a>, so link
19
+ // behavior is uniform across every blockType without each needing its
20
+ // own href-aware markup.
6
21
  export interface Props {
7
- block: { blockType: string; text: string; label?: string };
22
+ block: { blockType: string; text: string; label?: string; href?: string };
8
23
  class?: string;
9
24
  }
10
25
  const { block, class: className = '' } = Astro.props;
11
26
  const items = block.blockType === 'list' ? block.text.split('\n').filter(Boolean) : [];
27
+ const Wrapper = block.href ? 'a' : Fragment;
28
+ const wrapperProps = block.href ? { href: block.href, class: 'block no-underline' } : {};
12
29
  ---
30
+ <Wrapper {...wrapperProps}>
13
31
  {block.blockType === 'paragraph' && (
14
32
  <div class={className}>
15
33
  {block.label && <p class="font-display font-semibold text-accent-secondary mb-1">{block.label}</p>}
@@ -35,3 +53,10 @@ const items = block.blockType === 'list' ? block.text.split('\n').filter(Boolean
35
53
  </ul>
36
54
  </div>
37
55
  )}
56
+ {block.blockType === 'stat' && (
57
+ <p class={`font-display text-xl font-semibold text-accent-primary bg-accent-primary/5 rounded-md px-4 py-3 ${className}`}>{block.text}</p>
58
+ )}
59
+ {block.blockType === 'close' && (
60
+ <p class={`leading-relaxed border-t border-ink/10 pt-6 ${className}`}>{block.text}</p>
61
+ )}
62
+ </Wrapper>
@@ -16,6 +16,7 @@ import Status from './sections/Status.astro';
16
16
  import Sources from './sections/Sources.astro';
17
17
  import Cta from './sections/Cta.astro';
18
18
  import Legal from './sections/Legal.astro';
19
+ import Article from './sections/Article.astro';
19
20
  import CrossLink from './CrossLink.astro';
20
21
 
21
22
  const SECTION_COMPONENTS: Record<string, any> = {
@@ -29,6 +30,7 @@ const SECTION_COMPONENTS: Record<string, any> = {
29
30
  sources: Sources,
30
31
  cta: Cta,
31
32
  legal: Legal,
33
+ article: Article,
32
34
  };
33
35
 
34
36
  // icons is an optional, generic per-page mapping a consumer passes to opt a
@@ -0,0 +1,37 @@
1
+ ---
2
+ // Generic, page-level table of contents -- not article-specific. Derived
3
+ // directly from page.sections[].heading (the same real field every
4
+ // sections/*.astro component already renders as its own <h1>/<h2> and
5
+ // stamps as its section's DOM id via id={section.sectionId}), so a TOC
6
+ // entry always points at a real, already-rendered anchor -- never a
7
+ // fabricated one.
8
+ //
9
+ // Deliberately does not attempt to derive sub-headings from inside a
10
+ // single section's blocks[] -- content/article.schema.json's body has no
11
+ // heading-level chunk type (its chunk vocabulary is lede/section/pullquote/
12
+ // stat/close, none of which mark a subheading), so a real article today
13
+ // has nothing below section-level to link to. A consumer with genuinely
14
+ // multi-section content (e.g. an article split into several `article`
15
+ // sections, each with its own heading) gets a real, useful jump-list for
16
+ // free; a single-section page simply renders nothing here.
17
+ export interface Props {
18
+ sections: Array<{ sectionId: string; heading?: string }>;
19
+ class?: string;
20
+ }
21
+ const { sections, class: className = '' } = Astro.props;
22
+ const entries = (sections ?? []).filter((s) => s.heading);
23
+ ---
24
+ {entries.length > 1 && (
25
+ <nav class={`text-sm ${className}`} aria-label="Table of contents">
26
+ <p class="font-display font-semibold uppercase tracking-wide text-xs text-ink/50 mb-2">On this page</p>
27
+ <ul class="space-y-1.5 border-l border-ink/10">
28
+ {entries.map((s) => (
29
+ <li>
30
+ <a href={`#${s.sectionId}`} class="block pl-3 -ml-px border-l-2 border-transparent text-ink/70 hover:text-ink hover:border-accent-primary transition-colors">
31
+ {s.heading}
32
+ </a>
33
+ </li>
34
+ ))}
35
+ </ul>
36
+ </nav>
37
+ )}
@@ -0,0 +1,20 @@
1
+ ---
2
+ // sectionKind: article -- a long-form article body bridged from
3
+ // content/article.schema.json's canonical body via the article-venture-site
4
+ // channel-render (page.schema.json v1.1.0, d-2026-09-08-sr-article-venture-
5
+ // site-bridge). Blocks render in sequence exactly as authored -- lede first,
6
+ // then paragraph/pullquote/stat blocks in the article's own order, closing
7
+ // with a `close` block if the source article ended with one.
8
+ import Block from '../Block.astro';
9
+
10
+ export interface Props { section: any }
11
+ const { section } = Astro.props;
12
+ ---
13
+ <section id={section.sectionId} class="py-8" data-reveal>
14
+ {section.eyebrow && <p class="text-sm font-mono uppercase tracking-wide text-accent-primary mb-3">{section.eyebrow}</p>}
15
+ {section.heading && <h1 class="font-display text-3xl sm:text-4xl font-bold mb-3 max-w-2xl">{section.heading}</h1>}
16
+ {section.subheading && <p class="text-lg text-ink/80 max-w-2xl mb-6">{section.subheading}</p>}
17
+ <div class="max-w-2xl space-y-5">
18
+ {section.blocks?.map((b: any) => <Block block={b} />)}
19
+ </div>
20
+ </section>
@@ -3,7 +3,7 @@ import Ajv from 'ajv';
3
3
  import addFormats from 'ajv-formats';
4
4
  import { fetchSchema, fetchSupportSchema } from './schemaFetch.js';
5
5
 
6
- const PAGE_PIN = '1.0.0';
6
+ const PAGE_PIN = '1.1.0';
7
7
  const CAPABILITY_CLAIM_PIN = '0.2.0';
8
8
 
9
9
  let validatorPromise: ReturnType<typeof buildValidator> | null = null;
@@ -35,6 +35,7 @@ export interface PageBlock {
35
35
  blockType: string;
36
36
  text: string;
37
37
  label?: string;
38
+ href?: string;
38
39
  }
39
40
 
40
41
  export interface PageClaim {