@cogenta/theme-docs 0.3.2 → 0.5.3
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/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/render/blocks/accordion.d.ts +8 -0
- package/dist/src/render/blocks/accordion.d.ts.map +1 -1
- package/dist/src/render/blocks/accordion.js +10 -10
- package/dist/src/render/blocks/accordion.js.map +1 -1
- package/dist/src/render/blocks/collection-list.d.ts +3 -11
- package/dist/src/render/blocks/collection-list.d.ts.map +1 -1
- package/dist/src/render/blocks/collection-list.js +69 -68
- package/dist/src/render/blocks/collection-list.js.map +1 -1
- package/dist/src/render/blocks/cta.d.ts +6 -0
- package/dist/src/render/blocks/cta.d.ts.map +1 -1
- package/dist/src/render/blocks/cta.js +9 -4
- package/dist/src/render/blocks/cta.js.map +1 -1
- package/dist/src/render/blocks/embed.d.ts.map +1 -1
- package/dist/src/render/blocks/embed.js +14 -13
- package/dist/src/render/blocks/embed.js.map +1 -1
- package/dist/src/render/blocks/faq.d.ts +7 -0
- package/dist/src/render/blocks/faq.d.ts.map +1 -1
- package/dist/src/render/blocks/faq.js +10 -10
- package/dist/src/render/blocks/faq.js.map +1 -1
- package/dist/src/render/blocks/feature-grid.d.ts.map +1 -1
- package/dist/src/render/blocks/feature-grid.js +19 -19
- package/dist/src/render/blocks/feature-grid.js.map +1 -1
- package/dist/src/render/blocks/gallery.d.ts +8 -4
- package/dist/src/render/blocks/gallery.d.ts.map +1 -1
- package/dist/src/render/blocks/gallery.js +19 -13
- package/dist/src/render/blocks/gallery.js.map +1 -1
- package/dist/src/render/blocks/hero.d.ts +12 -9
- package/dist/src/render/blocks/hero.d.ts.map +1 -1
- package/dist/src/render/blocks/hero.js +22 -20
- package/dist/src/render/blocks/hero.js.map +1 -1
- package/dist/src/render/blocks/logo-strip.d.ts +6 -0
- package/dist/src/render/blocks/logo-strip.d.ts.map +1 -1
- package/dist/src/render/blocks/logo-strip.js +6 -10
- package/dist/src/render/blocks/logo-strip.js.map +1 -1
- package/dist/src/render/blocks/logos.d.ts +10 -0
- package/dist/src/render/blocks/logos.d.ts.map +1 -1
- package/dist/src/render/blocks/logos.js +20 -17
- package/dist/src/render/blocks/logos.js.map +1 -1
- package/dist/src/render/blocks/media-figure.d.ts +0 -6
- package/dist/src/render/blocks/media-figure.d.ts.map +1 -1
- package/dist/src/render/blocks/media-figure.js +28 -16
- package/dist/src/render/blocks/media-figure.js.map +1 -1
- package/dist/src/render/blocks/pricing-table.d.ts.map +1 -1
- package/dist/src/render/blocks/pricing-table.js +16 -20
- package/dist/src/render/blocks/pricing-table.js.map +1 -1
- package/dist/src/render/blocks/prose.d.ts +13 -1
- package/dist/src/render/blocks/prose.d.ts.map +1 -1
- package/dist/src/render/blocks/prose.js +12 -31
- package/dist/src/render/blocks/prose.js.map +1 -1
- package/dist/src/render/blocks/quote.d.ts +5 -3
- package/dist/src/render/blocks/quote.d.ts.map +1 -1
- package/dist/src/render/blocks/quote.js +10 -14
- package/dist/src/render/blocks/quote.js.map +1 -1
- package/dist/src/render/blocks/stat-counter.d.ts +5 -0
- package/dist/src/render/blocks/stat-counter.d.ts.map +1 -1
- package/dist/src/render/blocks/stat-counter.js +6 -10
- package/dist/src/render/blocks/stat-counter.js.map +1 -1
- package/dist/src/render/blocks/stats.d.ts +10 -0
- package/dist/src/render/blocks/stats.d.ts.map +1 -1
- package/dist/src/render/blocks/stats.js +13 -8
- package/dist/src/render/blocks/stats.js.map +1 -1
- package/dist/src/render/blocks/testimonial.d.ts +4 -5
- package/dist/src/render/blocks/testimonial.d.ts.map +1 -1
- package/dist/src/render/blocks/testimonial.js +9 -13
- package/dist/src/render/blocks/testimonial.js.map +1 -1
- package/dist/src/render/chrome.d.ts +36 -1
- package/dist/src/render/chrome.d.ts.map +1 -1
- package/dist/src/render/chrome.js +122 -80
- package/dist/src/render/chrome.js.map +1 -1
- package/dist/src/render/doc-index.d.ts +25 -0
- package/dist/src/render/doc-index.d.ts.map +1 -0
- package/dist/src/render/doc-index.js +49 -0
- package/dist/src/render/doc-index.js.map +1 -0
- package/dist/src/render/doc-page.d.ts +6 -0
- package/dist/src/render/doc-page.d.ts.map +1 -0
- package/dist/src/render/doc-page.js +127 -0
- package/dist/src/render/doc-page.js.map +1 -0
- package/dist/src/render/layout.d.ts +23 -0
- package/dist/src/render/layout.d.ts.map +1 -0
- package/dist/src/render/layout.js +40 -0
- package/dist/src/render/layout.js.map +1 -0
- package/dist/src/render/render-block.d.ts +9 -6
- package/dist/src/render/render-block.d.ts.map +1 -1
- package/dist/src/render/render-block.js +47 -100
- package/dist/src/render/render-block.js.map +1 -1
- package/dist/src/render/rich-text.d.ts +26 -0
- package/dist/src/render/rich-text.d.ts.map +1 -0
- package/dist/src/render/rich-text.js +325 -0
- package/dist/src/render/rich-text.js.map +1 -0
- package/dist/src/render/search.d.ts +15 -0
- package/dist/src/render/search.d.ts.map +1 -0
- package/dist/src/render/search.js +31 -0
- package/dist/src/render/search.js.map +1 -0
- package/dist/src/render/strings.d.ts +51 -0
- package/dist/src/render/strings.d.ts.map +1 -0
- package/dist/src/render/strings.js +60 -0
- package/dist/src/render/strings.js.map +1 -0
- package/dist/src/render/term-archive.d.ts +5 -5
- package/dist/src/render/term-archive.d.ts.map +1 -1
- package/dist/src/render/term-archive.js +27 -16
- package/dist/src/render/term-archive.js.map +1 -1
- package/dist/src/render/widget-areas.d.ts +22 -0
- package/dist/src/render/widget-areas.d.ts.map +1 -0
- package/dist/src/render/widget-areas.js +29 -0
- package/dist/src/render/widget-areas.js.map +1 -0
- package/package.json +4 -4
- package/src/index.ts +2 -0
- package/src/render/blocks/accordion.ts +31 -42
- package/src/render/blocks/collection-list.ts +132 -123
- package/src/render/blocks/cta.ts +23 -18
- package/src/render/blocks/embed.ts +37 -28
- package/src/render/blocks/faq.ts +26 -37
- package/src/render/blocks/feature-grid.ts +34 -42
- package/src/render/blocks/gallery.ts +33 -29
- package/src/render/blocks/hero.ts +41 -45
- package/src/render/blocks/logo-strip.ts +21 -21
- package/src/render/blocks/logos.ts +32 -42
- package/src/render/blocks/media-figure.ts +47 -25
- package/src/render/blocks/pricing-table.ts +34 -41
- package/src/render/blocks/prose.ts +25 -40
- package/src/render/blocks/quote.ts +25 -19
- package/src/render/blocks/stat-counter.ts +27 -29
- package/src/render/blocks/stats.ts +35 -32
- package/src/render/blocks/testimonial.ts +18 -19
- package/src/render/chrome.ts +170 -83
- package/src/render/doc-index.ts +65 -0
- package/src/render/doc-page.ts +303 -0
- package/src/render/layout.ts +73 -0
- package/src/render/render-block.ts +67 -191
- package/src/render/rich-text.ts +446 -0
- package/src/render/search.ts +41 -0
- package/src/render/strings.ts +67 -0
- package/src/render/term-archive.ts +62 -38
- package/src/render/widget-areas.ts +33 -0
- package/src/styles/archive.css +21 -27
- package/src/styles/base.css +438 -838
- package/src/styles/blocks.css +658 -916
- package/src/styles/chrome.css +439 -0
- package/src/styles/docs.css +404 -0
- package/src/styles/rich.css +337 -0
- package/src/styles/theme.css +28 -23
- package/src/styles/tokens.css +209 -215
- package/src/styles/widgets.css +890 -0
- package/tokens.json +15 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quote.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/quote.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,KAAK,WAAW,EAAY,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"quote.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/quote.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,KAAK,WAAW,EAAY,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAGnF;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CA6B9E"}
|
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
import { h, image } from '@cogenta/theme-kit';
|
|
2
|
+
import { optionalText, section } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* A quotation: in documentation, a line from an RFC, a maintainer or a team
|
|
5
|
+
* that runs the product. Set at the quote size on the reading measure, in
|
|
6
|
+
* real curly quotation marks drawn by the stylesheet, hanging from a rule in
|
|
7
|
+
* ink on its left; the attribution under it, with a small round portrait when
|
|
8
|
+
* there is one.
|
|
6
9
|
*/
|
|
7
10
|
export function renderQuote(block, ctx) {
|
|
8
|
-
const hasAttribution = block.author !== undefined || block.role !== undefined
|
|
9
|
-
return
|
|
10
|
-
? h('figcaption', { class: '
|
|
11
|
+
const hasAttribution = block.author !== undefined || block.role !== undefined;
|
|
12
|
+
return section('div', 'quote', 'cd-quote', {}, 'figure', h('blockquote', { class: 'cd-quote__body' }, h('p', { class: 'cd-quote__text', 'data-field': 'text' }, block.text)), hasAttribution
|
|
13
|
+
? h('figcaption', { class: 'cd-person' }, block.avatar === undefined
|
|
11
14
|
? null
|
|
12
|
-
: image(ctx, block.avatar, {
|
|
13
|
-
className: 'cg-quote__avatar',
|
|
14
|
-
variant: { width: 96, height: 96, fit: 'cover' },
|
|
15
|
-
}), block.author === undefined
|
|
16
|
-
? null
|
|
17
|
-
: h('span', { class: 'cg-quote__author', 'data-field': 'author' }, block.author), block.role === undefined
|
|
18
|
-
? null
|
|
19
|
-
: h('span', { class: 'cg-quote__role', 'data-field': 'role' }, block.role))
|
|
15
|
+
: image(ctx, block.avatar, { className: 'cd-person__avatar', sizes: '2.5rem' }), h('span', { class: 'cd-person__words' }, optionalText('span', 'cd-person__name', block.author, { 'data-field': 'author' }), optionalText('span', 'cd-person__role', block.role, { 'data-field': 'role' })))
|
|
20
16
|
: null);
|
|
21
17
|
}
|
|
22
18
|
//# sourceMappingURL=quote.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quote.js","sourceRoot":"","sources":["../../../../src/render/blocks/quote.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,CAAC,EAAE,KAAK,EAAsB,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"quote.js","sourceRoot":"","sources":["../../../../src/render/blocks/quote.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,CAAC,EAAE,KAAK,EAAsB,MAAM,oBAAoB,CAAA;AACnF,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEpD;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,KAAiB,EAAE,GAAkB;IAC/D,MAAM,cAAc,GAAG,KAAK,CAAC,MAAM,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,CAAA;IAC7E,OAAO,OAAO,CACZ,KAAK,EACL,OAAO,EACP,UAAU,EACV,EAAE,EACF,QAAQ,EACR,CAAC,CACC,YAAY,EACZ,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAC3B,CAAC,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,KAAK,CAAC,IAAI,CAAC,CACtE,EACD,cAAc;QACZ,CAAC,CAAC,CAAC,CACC,YAAY,EACZ,EAAE,KAAK,EAAE,WAAW,EAAE,EACtB,KAAK,CAAC,MAAM,KAAK,SAAS;YACxB,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,mBAAmB,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,EACjF,CAAC,CACC,MAAM,EACN,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAC7B,YAAY,CAAC,MAAM,EAAE,iBAAiB,EAAE,KAAK,CAAC,MAAM,EAAE,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,EACjF,YAAY,CAAC,MAAM,EAAE,iBAAiB,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,CAC9E,CACF;QACH,CAAC,CAAC,IAAI,CACT,CAAA;AACH,CAAC"}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { StatCounterBlock } from '@cogenta/blocks';
|
|
2
2
|
import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
|
|
3
|
+
/**
|
|
4
|
+
* A row of counts ("Releases this year", "Supported runtimes"): the same
|
|
5
|
+
* ruled, tabular register as `stats`, without units. Nothing counts up on
|
|
6
|
+
* scroll; the figure is simply printed.
|
|
7
|
+
*/
|
|
3
8
|
export declare function renderStatCounter(block: StatCounterBlock, _ctx: RenderContext): HtmlElement;
|
|
4
9
|
//# sourceMappingURL=stat-counter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stat-counter.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/stat-counter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,
|
|
1
|
+
{"version":3,"file":"stat-counter.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/stat-counter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,KAAK,WAAW,EAAK,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAG5E;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,aAAa,GAAG,WAAW,CAyB3F"}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h } from '@cogenta/theme-kit';
|
|
2
|
+
import { section, sectionHead } from '../layout.js';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* figure
|
|
4
|
+
* A row of counts ("Releases this year", "Supported runtimes"): the same
|
|
5
|
+
* ruled, tabular register as `stats`, without units. Nothing counts up on
|
|
6
|
+
* scroll; the figure is simply printed.
|
|
6
7
|
*/
|
|
7
|
-
function renderItem(item) {
|
|
8
|
-
return h('div', { class: 'cg-kpi' }, h('dt', { class: 'cg-kpi__label' }, item.label), h('dd', { class: 'cg-kpi__value' }, item.value));
|
|
9
|
-
}
|
|
10
8
|
export function renderStatCounter(block, _ctx) {
|
|
11
|
-
return
|
|
12
|
-
? null
|
|
13
|
-
: heading(blockHeadingTag('statCounter') ?? 'h2', { class: 'cg-kpis__title', 'data-field': 'title' }, block.title), h('dl', { class: 'cg-kpis__items' }, block.stats.map(renderItem)));
|
|
9
|
+
return section('section', 'statCounter', 'cd-figures', { 'data-count': String(Math.min(block.stats.length, 4)) }, 'div', sectionHead('statCounter', block.title), h('dl', { class: 'cd-figures__items' }, block.stats.map((stat) => h('div', { class: 'cd-figures__item' }, h('dt', { class: 'cd-figures__label' }, stat.label), h('dd', { class: 'cd-figures__value' }, h('span', { class: 'cd-figures__number' }, stat.value))))));
|
|
14
10
|
}
|
|
15
11
|
//# sourceMappingURL=stat-counter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stat-counter.js","sourceRoot":"","sources":["../../../../src/render/blocks/stat-counter.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"stat-counter.js","sourceRoot":"","sources":["../../../../src/render/blocks/stat-counter.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,CAAC,EAAsB,MAAM,oBAAoB,CAAA;AAC5E,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAEnD;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAuB,EAAE,IAAmB;IAC5E,OAAO,OAAO,CACZ,SAAS,EACT,aAAa,EACb,YAAY,EACZ,EAAE,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EACzD,KAAK,EACL,WAAW,CAAC,aAAa,EAAE,KAAK,CAAC,KAAK,CAAC,EACvC,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAC9B,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACvB,CAAC,CACC,KAAK,EACL,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAC7B,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EACnD,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAC9B,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,oBAAoB,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,CACvD,CACF,CACF,CACF,CACF,CAAA;AACH,CAAC"}
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import type { StatsBlock } from '@cogenta/blocks';
|
|
2
2
|
import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
|
|
3
|
+
/**
|
|
4
|
+
* Figures the way a benchmark or a limits page prints them: a ruled row of
|
|
5
|
+
* up to four columns, each value in tabular numerals with its unit smaller on
|
|
6
|
+
* the same baseline, and a one-line label under it. The rule above each
|
|
7
|
+
* figure is the only structure; there is no box behind the row.
|
|
8
|
+
*
|
|
9
|
+
* A `<dl>`, since each figure is the value of its label; the label comes
|
|
10
|
+
* first in the markup (so it is announced first) and is drawn under the
|
|
11
|
+
* figure.
|
|
12
|
+
*/
|
|
3
13
|
export declare function renderStats(block: StatsBlock, _ctx: RenderContext): HtmlElement;
|
|
4
14
|
//# sourceMappingURL=stats.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/stats.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/stats.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,KAAK,WAAW,EAAK,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAG5E;;;;;;;;;GASG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,GAAG,WAAW,CA0B/E"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { h } from '@cogenta/theme-kit';
|
|
2
|
+
import { optionalText, section, sectionHead } from '../layout.js';
|
|
3
|
+
/**
|
|
4
|
+
* Figures the way a benchmark or a limits page prints them: a ruled row of
|
|
5
|
+
* up to four columns, each value in tabular numerals with its unit smaller on
|
|
6
|
+
* the same baseline, and a one-line label under it. The rule above each
|
|
7
|
+
* figure is the only structure; there is no box behind the row.
|
|
8
|
+
*
|
|
9
|
+
* A `<dl>`, since each figure is the value of its label; the label comes
|
|
10
|
+
* first in the markup (so it is announced first) and is drawn under the
|
|
11
|
+
* figure.
|
|
12
|
+
*/
|
|
6
13
|
export function renderStats(block, _ctx) {
|
|
7
|
-
return
|
|
8
|
-
? null
|
|
9
|
-
: heading(blockHeadingTag('stats') ?? 'h2', { class: 'cg-stats__title', 'data-field': 'title' }, block.title), h('dl', { class: 'cg-stats__items' }, block.items.map(renderItem)));
|
|
14
|
+
return section('section', 'stats', 'cd-figures', { 'data-count': String(Math.min(block.items.length, 4)) }, 'div', sectionHead('stats', block.title), h('dl', { class: 'cd-figures__items' }, block.items.map((item) => h('div', { class: 'cd-figures__item' }, h('dt', { class: 'cd-figures__label' }, item.label), h('dd', { class: 'cd-figures__value' }, h('span', { class: 'cd-figures__number' }, item.value), optionalText('span', 'cd-figures__unit', item.unit))))));
|
|
10
15
|
}
|
|
11
16
|
//# sourceMappingURL=stats.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stats.js","sourceRoot":"","sources":["../../../../src/render/blocks/stats.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"stats.js","sourceRoot":"","sources":["../../../../src/render/blocks/stats.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,CAAC,EAAsB,MAAM,oBAAoB,CAAA;AAC5E,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAEjE;;;;;;;;;GASG;AACH,MAAM,UAAU,WAAW,CAAC,KAAiB,EAAE,IAAmB;IAChE,OAAO,OAAO,CACZ,SAAS,EACT,OAAO,EACP,YAAY,EACZ,EAAE,YAAY,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EACzD,KAAK,EACL,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,EACjC,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAC9B,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACvB,CAAC,CACC,KAAK,EACL,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAC7B,CAAC,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EACnD,CAAC,CACC,IAAI,EACJ,EAAE,KAAK,EAAE,mBAAmB,EAAE,EAC9B,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,oBAAoB,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,EACtD,YAAY,CAAC,MAAM,EAAE,kBAAkB,EAAE,IAAI,CAAC,IAAI,CAAC,CACpD,CACF,CACF,CACF,CACF,CAAA;AACH,CAAC"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import type { TestimonialBlock } from '@cogenta/blocks';
|
|
2
2
|
import { type HtmlElement, type RenderContext } from '@cogenta/theme-kit';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* the
|
|
8
|
-
* ones.
|
|
4
|
+
* One person's account of using the product: the same register as `quote`
|
|
5
|
+
* (a rule in ink on the left, real quotation marks), with rich text, so a
|
|
6
|
+
* testimonial can hold a second paragraph or a command in `code`. The first
|
|
7
|
+
* paragraph is set at the quote size, the rest at the reading size.
|
|
9
8
|
*/
|
|
10
9
|
export declare function renderTestimonial(block: TestimonialBlock, ctx: RenderContext): HtmlElement;
|
|
11
10
|
//# sourceMappingURL=testimonial.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testimonial.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/testimonial.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,KAAK,WAAW,EAAY,KAAK,aAAa,
|
|
1
|
+
{"version":3,"file":"testimonial.d.ts","sourceRoot":"","sources":["../../../../src/render/blocks/testimonial.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,KAAK,WAAW,EAAY,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAInF;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,aAAa,GAAG,WAAW,CAuB1F"}
|
|
@@ -1,20 +1,16 @@
|
|
|
1
|
-
import { h, image
|
|
1
|
+
import { h, image } from '@cogenta/theme-kit';
|
|
2
|
+
import { optionalText, section } from '../layout.js';
|
|
3
|
+
import { renderDocsRichText } from '../rich-text.js';
|
|
2
4
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* the
|
|
7
|
-
* ones.
|
|
5
|
+
* One person's account of using the product: the same register as `quote`
|
|
6
|
+
* (a rule in ink on the left, real quotation marks), with rich text, so a
|
|
7
|
+
* testimonial can hold a second paragraph or a command in `code`. The first
|
|
8
|
+
* paragraph is set at the quote size, the rest at the reading size.
|
|
8
9
|
*/
|
|
9
10
|
export function renderTestimonial(block, ctx) {
|
|
10
11
|
const { attribution } = block;
|
|
11
|
-
return
|
|
12
|
+
return section('div', 'testimonial', 'cd-testimonial', {}, 'figure', h('blockquote', { class: 'cd-testimonial__quote' }, renderDocsRichText(ctx, block.quote)), h('figcaption', { class: 'cd-person' }, attribution.avatar === undefined
|
|
12
13
|
? null
|
|
13
|
-
: image(ctx, attribution.avatar, {
|
|
14
|
-
className: 'cg-testimonial__avatar',
|
|
15
|
-
variant: { width: 96, height: 96, fit: 'cover' },
|
|
16
|
-
}), h('span', { class: 'cg-testimonial__who' }, h('span', { class: 'cg-testimonial__name' }, attribution.name), attribution.role === undefined
|
|
17
|
-
? null
|
|
18
|
-
: h('span', { class: 'cg-testimonial__role' }, attribution.role))));
|
|
14
|
+
: image(ctx, attribution.avatar, { className: 'cd-person__avatar', sizes: '2.5rem' }), h('span', { class: 'cd-person__words' }, h('span', { class: 'cd-person__name' }, attribution.name), optionalText('span', 'cd-person__role', attribution.role))));
|
|
19
15
|
}
|
|
20
16
|
//# sourceMappingURL=testimonial.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testimonial.js","sourceRoot":"","sources":["../../../../src/render/blocks/testimonial.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,CAAC,EAAE,KAAK,EAAsB,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"testimonial.js","sourceRoot":"","sources":["../../../../src/render/blocks/testimonial.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,CAAC,EAAE,KAAK,EAAsB,MAAM,oBAAoB,CAAA;AACnF,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAEpD;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAuB,EAAE,GAAkB;IAC3E,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,CAAA;IAC7B,OAAO,OAAO,CACZ,KAAK,EACL,aAAa,EACb,gBAAgB,EAChB,EAAE,EACF,QAAQ,EACR,CAAC,CAAC,YAAY,EAAE,EAAE,KAAK,EAAE,uBAAuB,EAAE,EAAE,kBAAkB,CAAC,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EACzF,CAAC,CACC,YAAY,EACZ,EAAE,KAAK,EAAE,WAAW,EAAE,EACtB,WAAW,CAAC,MAAM,KAAK,SAAS;QAC9B,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,WAAW,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,mBAAmB,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,EACvF,CAAC,CACC,MAAM,EACN,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAC7B,CAAC,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,EAAE,WAAW,CAAC,IAAI,CAAC,EACzD,YAAY,CAAC,MAAM,EAAE,iBAAiB,EAAE,WAAW,CAAC,IAAI,CAAC,CAC1D,CACF,CACF,CAAA;AACH,CAAC"}
|
|
@@ -1,3 +1,38 @@
|
|
|
1
|
-
import { type ChromeInput, type ChromeResult } from '@cogenta/theme-kit';
|
|
1
|
+
import { type ChromeInput, type ChromeNavLink, type ChromeResult } from '@cogenta/theme-kit';
|
|
2
|
+
/**
|
|
3
|
+
* The header and footer of a documentation site (`theme@1.4`).
|
|
4
|
+
*
|
|
5
|
+
* Header: one bar held at the top of the window on the page's own ground,
|
|
6
|
+
* under a hairline (no blur, no translucency). The product's name as a text
|
|
7
|
+
* wordmark (or the uploaded logo), a real search field, the top sections of
|
|
8
|
+
* the site, the light/dark control, and the `headerAction` as a quiet
|
|
9
|
+
* outlined control when a site sets one.
|
|
10
|
+
*
|
|
11
|
+
* Below the wide breakpoint the sections and the search field move into a
|
|
12
|
+
* panel opened by a `<details>` disclosure: no script. The panel is a second,
|
|
13
|
+
* hidden-by-default copy of the same links: at any width exactly one copy is
|
|
14
|
+
* displayed, so a screen reader is never offered two primary navigations. A
|
|
15
|
+
* magnifier link to the search page stays in the bar, so a reader on a phone
|
|
16
|
+
* can search without opening the menu.
|
|
17
|
+
*
|
|
18
|
+
* Footer: columns, the way a developer tool's site is organised. The name,
|
|
19
|
+
* the `tagline`, the `footerNote` (a licence line, a support address) and the
|
|
20
|
+
* social profiles; then the footer navigation, split into columns at each
|
|
21
|
+
* unlinked heading (`submenu-placeholder`) an editor adds in the menu screen.
|
|
22
|
+
* Under a hairline, the copyright year and the product's name, beside the
|
|
23
|
+
* host's `brandingHtml`, placed once, as received.
|
|
24
|
+
*
|
|
25
|
+
* Footer widget columns (`theme@1.6`), when the site placed any, sit between
|
|
26
|
+
* the two, under their own hairline: a row of columns set like the footer
|
|
27
|
+
* navigation's, so a support address or a status link reads as part of the
|
|
28
|
+
* same footer rather than a band added above it.
|
|
29
|
+
*/
|
|
30
|
+
interface FooterGroup {
|
|
31
|
+
readonly heading: string | null;
|
|
32
|
+
readonly links: readonly ChromeNavLink[];
|
|
33
|
+
}
|
|
34
|
+
/** The footer menu, split into columns at each unlinked heading. */
|
|
35
|
+
export declare function footerGroups(links: readonly ChromeNavLink[]): readonly FooterGroup[];
|
|
2
36
|
export declare function renderChrome(input: ChromeInput): ChromeResult;
|
|
37
|
+
export {};
|
|
3
38
|
//# sourceMappingURL=chrome.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chrome.d.ts","sourceRoot":"","sources":["../../../src/render/chrome.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,
|
|
1
|
+
{"version":3,"file":"chrome.d.ts","sourceRoot":"","sources":["../../../src/render/chrome.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,YAAY,EASlB,MAAM,oBAAoB,CAAA;AAI3B;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,UAAU,WAAW;IACnB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,QAAQ,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,CAAA;CACzC;AAcD,oEAAoE;AACpE,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,aAAa,EAAE,GAAG,SAAS,WAAW,EAAE,CAYpF;AA4BD,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,YAAY,CA2G7D"}
|
|
@@ -1,94 +1,136 @@
|
|
|
1
|
-
import { escapeAttribute, escapeText, renderBrandMark, renderSocialLinks, renderThemeToggle, serialize, } from '@cogenta/theme-kit';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* because "Docs / Guides / Reference / Blog" plus a header action does not
|
|
7
|
-
* fit a narrow viewport the way three links do.
|
|
8
|
-
*
|
|
9
|
-
* The mobile panel is a **second, hidden-by-default copy** of the same nav
|
|
10
|
-
* markup, not a repositioned single copy: two static layouts (`display:none`
|
|
11
|
-
* either way at a given viewport width) is the only zero-JS way to put the
|
|
12
|
-
* links inline on a wide screen and inside a disclosure on a narrow one.
|
|
13
|
-
* `display:none` removes the inactive copy from the accessibility tree, so a
|
|
14
|
-
* screen reader is never offered two "Primary" navigations at once — only
|
|
15
|
-
* the sighted, CSS-driven layout differs.
|
|
16
|
-
*
|
|
17
|
-
* Footer: brand column (name + tagline), a footer nav column, social links,
|
|
18
|
-
* a short "about" note, and Cogenta's own credit (or its white-label
|
|
19
|
-
* replacement) — `brandingHtml` placed exactly once, unaltered.
|
|
20
|
-
*/
|
|
21
|
-
function navItems(links) {
|
|
22
|
-
return links
|
|
23
|
-
.filter((link) => link.href !== null || link.kind === 'submenu-placeholder')
|
|
24
|
-
.map((link) => {
|
|
25
|
-
const label = escapeText(link.label);
|
|
26
|
-
const titleAttr = link.title === null ? '' : ` title="${escapeAttribute(link.title)}"`;
|
|
27
|
-
if (link.href === null)
|
|
28
|
-
return `<li><span${titleAttr}>${label}</span></li>`;
|
|
29
|
-
const href = escapeAttribute(link.href);
|
|
30
|
-
const target = link.openInNewTab ? ' target="_blank" rel="noopener"' : '';
|
|
31
|
-
return `<li><a href="${href}"${target}${titleAttr}>${label}</a></li>`;
|
|
32
|
-
})
|
|
33
|
-
.join('');
|
|
1
|
+
import { escapeAttribute, escapeText, renderBrandMark, renderFooterWidgets, renderIcon, renderSocialLinks, renderThemeToggle, serialize, } from '@cogenta/theme-kit';
|
|
2
|
+
import { renderSearchForm, SEARCH_PATH } from './search.js';
|
|
3
|
+
import { splitSiteName, word } from './strings.js';
|
|
4
|
+
function usable(links) {
|
|
5
|
+
return links.filter((link) => link.href !== null || link.kind === 'submenu-placeholder');
|
|
34
6
|
}
|
|
35
|
-
function
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
7
|
+
function linkItem(link, className) {
|
|
8
|
+
const label = escapeText(link.label);
|
|
9
|
+
const titleAttr = link.title === null ? '' : ` title="${escapeAttribute(link.title)}"`;
|
|
10
|
+
if (link.href === null)
|
|
11
|
+
return `<li class="${className}"><span${titleAttr}>${label}</span></li>`;
|
|
12
|
+
const target = link.openInNewTab ? ' target="_blank" rel="noopener"' : '';
|
|
13
|
+
return `<li class="${className}"><a href="${escapeAttribute(link.href)}"${target}${titleAttr}>${label}</a></li>`;
|
|
40
14
|
}
|
|
41
|
-
/** The
|
|
42
|
-
function
|
|
43
|
-
|
|
15
|
+
/** The footer menu, split into columns at each unlinked heading. */
|
|
16
|
+
export function footerGroups(links) {
|
|
17
|
+
const groups = [];
|
|
18
|
+
for (const link of usable(links)) {
|
|
19
|
+
if (link.kind === 'submenu-placeholder' && link.href === null) {
|
|
20
|
+
groups.push({ heading: link.label, links: [] });
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
const current = groups[groups.length - 1];
|
|
24
|
+
if (current === undefined)
|
|
25
|
+
groups.push({ heading: null, links: [link] });
|
|
26
|
+
else
|
|
27
|
+
current.links.push(link);
|
|
28
|
+
}
|
|
29
|
+
return groups.filter((group) => group.links.length > 0);
|
|
30
|
+
}
|
|
31
|
+
/** `footerNote` as paragraphs at blank lines, each keeping its own line breaks. */
|
|
32
|
+
function renderFooterNote(note) {
|
|
33
|
+
const paragraphs = note
|
|
34
|
+
.replace(/\r\n?/g, '\n')
|
|
35
|
+
.split(/\n\s*\n/)
|
|
36
|
+
.map((paragraph) => paragraph
|
|
37
|
+
.split('\n')
|
|
38
|
+
.map((line) => line.trim())
|
|
39
|
+
.filter((line) => line !== ''))
|
|
40
|
+
.filter((lines) => lines.length > 0);
|
|
41
|
+
if (paragraphs.length === 0)
|
|
44
42
|
return '';
|
|
45
|
-
return
|
|
46
|
-
|
|
43
|
+
return `<div class="cd-footer__note">${paragraphs
|
|
44
|
+
.map((lines) => `<p>${lines.map((line) => escapeText(line)).join('<br>')}</p>`)
|
|
45
|
+
.join('')}</div>`;
|
|
46
|
+
}
|
|
47
|
+
/** "Relay Docs" as the product in ink and the kind of site in grey; any other name as it is. */
|
|
48
|
+
function wordmark(name) {
|
|
49
|
+
const { product, suffix } = splitSiteName(name);
|
|
50
|
+
const productHtml = `<span class="cd-wordmark__product">${escapeText(product)}</span>`;
|
|
51
|
+
if (suffix === null)
|
|
52
|
+
return `<span class="cd-wordmark">${productHtml}</span>`;
|
|
53
|
+
return `<span class="cd-wordmark">${productHtml} <span class="cd-wordmark__kind">${escapeText(suffix)}</span></span>`;
|
|
47
54
|
}
|
|
48
|
-
/** Three bars, drawn once for this file — not part of `renderIcon`'s closed vocabulary, since a "menu" glyph names no contract B field. */
|
|
49
|
-
const HAMBURGER_SVG = '<svg class="cg-nav-toggle__icon" viewBox="0 0 24 24" width="22" height="22" fill="none" ' +
|
|
50
|
-
'stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true" focusable="false">' +
|
|
51
|
-
'<path d="M4 6h16M4 12h16M4 18h16"/></svg>';
|
|
52
55
|
export function renderChrome(input) {
|
|
53
|
-
const
|
|
54
|
-
const
|
|
55
|
-
const
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
-
const
|
|
56
|
+
const locale = input.locale;
|
|
57
|
+
const siteName = escapeText(input.site.name);
|
|
58
|
+
const home = escapeAttribute(input.homeHref);
|
|
59
|
+
const headerLinks = usable(input.headerNav)
|
|
60
|
+
.map((link) => linkItem(link, 'cd-header__item'))
|
|
61
|
+
.join('');
|
|
62
|
+
const logo = renderBrandMark(input.brand, { className: 'cd-header__logo' });
|
|
63
|
+
const mark = logo ?? wordmark(input.site.name);
|
|
64
|
+
const toggle = serialize(renderThemeToggle(locale, { className: 'cg-theme-toggle' }));
|
|
65
|
+
const action = input.headerAction === undefined
|
|
66
|
+
? ''
|
|
67
|
+
: `<a class="cg-action cd-header__action" data-emphasis="outline" href="${escapeAttribute(input.headerAction.href)}">${escapeText(input.headerAction.label)}</a>`;
|
|
68
|
+
const nav = headerLinks === ''
|
|
69
|
+
? ''
|
|
70
|
+
: `<nav class="cd-header__nav" aria-label="${escapeAttribute(word(locale, 'primary'))}">` +
|
|
71
|
+
`<ul class="cd-header__links">${headerLinks}</ul></nav>`;
|
|
72
|
+
const searchIcon = renderIcon('search', { className: 'cd-header__search-icon', size: 20 });
|
|
73
|
+
const searchLink = `<a class="cd-header__search-link" href="${SEARCH_PATH}" ` +
|
|
74
|
+
`aria-label="${escapeAttribute(word(locale, 'search'))}">` +
|
|
75
|
+
`${searchIcon === null ? '' : serialize(searchIcon)}</a>`;
|
|
76
|
+
const panelLinks = headerLinks === ''
|
|
62
77
|
? ''
|
|
63
|
-
: `<nav class="
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
78
|
+
: `<nav class="cd-menu__nav" aria-label="${escapeAttribute(word(locale, 'primary'))}">` +
|
|
79
|
+
`<ul class="cd-menu__links">${usable(input.headerNav)
|
|
80
|
+
.map((link) => linkItem(link, 'cd-menu__item'))
|
|
81
|
+
.join('')}</ul></nav>`;
|
|
82
|
+
const panelAction = input.headerAction === undefined
|
|
67
83
|
? ''
|
|
68
|
-
: `<
|
|
69
|
-
const
|
|
70
|
-
`<
|
|
71
|
-
|
|
84
|
+
: `<a class="cg-action cd-menu__action" data-emphasis="outline" href="${escapeAttribute(input.headerAction.href)}">${escapeText(input.headerAction.label)}</a>`;
|
|
85
|
+
const menu = `<details class="cd-menu">` +
|
|
86
|
+
`<summary class="cd-menu__button" aria-label="${escapeAttribute(word(locale, 'menu'))}">` +
|
|
87
|
+
`<span class="cd-menu__bar"></span><span class="cd-menu__bar"></span></summary>` +
|
|
88
|
+
`<div class="cd-menu__panel">` +
|
|
89
|
+
`${serialize(renderSearchForm(locale, 'cd-search-menu', 'compact'))}${panelLinks}${panelAction}` +
|
|
90
|
+
`</div></details>`;
|
|
91
|
+
const header = `<header class="cd-header"><div class="cd-header__inner">` +
|
|
92
|
+
`<a class="cd-header__brand" href="${home}">${mark}</a>` +
|
|
93
|
+
`<div class="cd-header__search">${serialize(renderSearchForm(locale, 'cd-search-header', 'compact'))}</div>` +
|
|
94
|
+
`${nav}` +
|
|
95
|
+
`<div class="cd-header__end">${searchLink}${action}${toggle}${menu}</div>` +
|
|
72
96
|
`</div></header>`;
|
|
73
|
-
const footerNav = renderNav(input.footerNav, 'cg-site-footer__nav', 'Footer');
|
|
74
97
|
const tagline = input.tagline === undefined
|
|
75
98
|
? ''
|
|
76
|
-
: `<p class="
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const
|
|
84
|
-
const footerNote = input.footerNote === undefined
|
|
99
|
+
: `<p class="cd-footer__tagline" data-field="tagline">${escapeText(input.tagline)}</p>`;
|
|
100
|
+
const note = input.footerNote === undefined ? '' : renderFooterNote(input.footerNote);
|
|
101
|
+
const social = renderSocialLinks(input.social, {
|
|
102
|
+
className: 'cd-footer__social',
|
|
103
|
+
itemClassName: 'cd-footer__social-item',
|
|
104
|
+
});
|
|
105
|
+
const groups = footerGroups(input.footerNav);
|
|
106
|
+
const footerNav = groups.length === 0
|
|
85
107
|
? ''
|
|
86
|
-
: `<
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
108
|
+
: `<nav class="cd-footer__nav" aria-label="${escapeAttribute(word(locale, 'footer'))}" data-columns="${Math.min(groups.length, 4)}">${groups
|
|
109
|
+
.map((group) => `<div class="cd-footer__group">${group.heading === null
|
|
110
|
+
? ''
|
|
111
|
+
: `<p class="cd-footer__heading">${escapeText(group.heading)}</p>`}<ul class="cd-footer__links">${group.links
|
|
112
|
+
.map((link) => linkItem(link, 'cd-footer__item'))
|
|
113
|
+
.join('')}</ul></div>`)
|
|
114
|
+
.join('')}</nav>`;
|
|
115
|
+
const year = new Date().getFullYear();
|
|
116
|
+
const owner = escapeText(splitSiteName(input.site.name).product);
|
|
117
|
+
const footerWidgets = renderFooterWidgets(input.widgets, {
|
|
118
|
+
className: 'cd-footer__widgets',
|
|
119
|
+
headingLevel: 'h2',
|
|
120
|
+
});
|
|
121
|
+
const footer = `<footer class="cd-footer"><div class="cd-footer__inner">` +
|
|
122
|
+
`<div class="cd-footer__about">` +
|
|
123
|
+
`<a class="cd-footer__name" href="${home}">${siteName}</a>` +
|
|
124
|
+
`${tagline}${note}` +
|
|
125
|
+
`${social === null ? '' : serialize(social)}` +
|
|
126
|
+
`</div>` +
|
|
127
|
+
`${footerNav}` +
|
|
128
|
+
`${footerWidgets === null ? '' : serialize(footerWidgets)}` +
|
|
129
|
+
`<div class="cd-footer__legal">` +
|
|
130
|
+
`<p class="cd-footer__copyright">© ${year} ${owner}</p>` +
|
|
131
|
+
`${input.brandingHtml === '' ? '' : `<div class="cd-footer__branding">${input.brandingHtml}</div>`}` +
|
|
132
|
+
`</div>` +
|
|
133
|
+
`</div></footer>`;
|
|
92
134
|
return { header, footer };
|
|
93
135
|
}
|
|
94
136
|
//# sourceMappingURL=chrome.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chrome.js","sourceRoot":"","sources":["../../../src/render/chrome.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,eAAe,EACf,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,SAAS,GACV,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"chrome.js","sourceRoot":"","sources":["../../../src/render/chrome.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,eAAe,EACf,UAAU,EACV,eAAe,EACf,mBAAmB,EACnB,UAAU,EACV,iBAAiB,EACjB,iBAAiB,EACjB,SAAS,GACV,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAoClD,SAAS,MAAM,CAAC,KAA+B;IAC7C,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,qBAAqB,CAAC,CAAA;AAC1F,CAAC;AAED,SAAS,QAAQ,CAAC,IAAmB,EAAE,SAAiB;IACtD,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACpC,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,KAAK,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E,CAAA;IACrC,MAAM,KAAK,GAAG,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAA;IAChE,MAAM,aAAa,GAAG,mBAAmB,CAAC,KAAK,CAAC,OAAO,EAAE;QACvD,SAAS,EAAE,oBAAoB;QAC/B,YAAY,EAAE,IAAI;KACnB,CAAC,CAAA;IAEF,MAAM,MAAM,GACV,0DAA0D;QAC1D,gCAAgC;QAChC,oCAAoC,IAAI,KAAK,QAAQ,MAAM;QAC3D,GAAG,OAAO,GAAG,IAAI,EAAE;QACnB,GAAG,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE;QAC7C,QAAQ;QACR,GAAG,SAAS,EAAE;QACd,GAAG,aAAa,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,EAAE;QAC3D,gCAAgC;QAChC,qCAAqC,IAAI,IAAI,KAAK,MAAM;QACxD,GAAG,KAAK,CAAC,YAAY,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,oCAAoC,KAAK,CAAC,YAAY,QAAQ,EAAE;QACpG,QAAQ;QACR,iBAAiB,CAAA;IAEnB,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAA;AAC3B,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { CollectionListBlock, VocabularyBlock } from '@cogenta/blocks';
|
|
2
|
+
import type { ContentEntry, RenderContext } from '@cogenta/theme-kit';
|
|
3
|
+
/**
|
|
4
|
+
* The documentation's own order, shared by the sidebar, the home page index
|
|
5
|
+
* and previous/next.
|
|
6
|
+
*
|
|
7
|
+
* A doc page carries two plain fields: `section` (the group it belongs to)
|
|
8
|
+
* and `order` (its place in that group). Neither is a sort field contract B
|
|
9
|
+
* allows a `collectionList` to ask for (`id`/`createdAt`/`updatedAt` only),
|
|
10
|
+
* so the list is fetched by creation date and ordered here: pages within a
|
|
11
|
+
* section by `order`, then by the order they were fetched in; sections by the
|
|
12
|
+
* smallest `order` they hold, then by the order they first appear. Two pages
|
|
13
|
+
* created in the same millisecond can come back in either order, so the
|
|
14
|
+
* documentation never depends on creation time alone.
|
|
15
|
+
*/
|
|
16
|
+
export declare const DOC_PAGE_COLLECTION = "doc_page";
|
|
17
|
+
export interface DocGroup {
|
|
18
|
+
readonly section: string;
|
|
19
|
+
readonly entries: readonly ContentEntry[];
|
|
20
|
+
}
|
|
21
|
+
export declare function isDocIndexBlock(block: VocabularyBlock): block is CollectionListBlock;
|
|
22
|
+
export declare function groupDocPages(entries: readonly ContentEntry[], ctx: RenderContext): readonly DocGroup[];
|
|
23
|
+
/** The reading order of the whole documentation: every group, in turn. */
|
|
24
|
+
export declare function readingOrder(groups: readonly DocGroup[]): readonly ContentEntry[];
|
|
25
|
+
//# sourceMappingURL=doc-index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doc-index.d.ts","sourceRoot":"","sources":["../../../src/render/doc-index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAC3E,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAErE;;;;;;;;;;;;GAYG;AAEH,eAAO,MAAM,mBAAmB,aAAa,CAAA;AAE7C,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,CAAA;CAC1C;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,eAAe,GAAG,KAAK,IAAI,mBAAmB,CAEpF;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE,SAAS,YAAY,EAAE,EAChC,GAAG,EAAE,aAAa,GACjB,SAAS,QAAQ,EAAE,CA4BrB;AAED,0EAA0E;AAC1E,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,QAAQ,EAAE,GAAG,SAAS,YAAY,EAAE,CAEjF"}
|