@aitrien/motifspec 1.13.0 → 1.13.2

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.
Files changed (83) hide show
  1. package/CHANGELOG.md +269 -257
  2. package/LICENSE +21 -21
  3. package/README.md +150 -150
  4. package/dist/backdrop.html +1 -1
  5. package/dist/chroma.css +36 -36
  6. package/dist/codex.css +1145 -1145
  7. package/dist/codex.js +126 -126
  8. package/dist/contrast.md +101 -101
  9. package/dist/fonts.css +3 -3
  10. package/dist/icons.svg +18 -18
  11. package/dist/plate.html +1 -1
  12. package/dist/plate.js +292 -292
  13. package/dist/theme-init.js +1 -1
  14. package/dist/tokens.css +466 -466
  15. package/dist/tokens.js +3330 -3330
  16. package/dist/tokens.json +3330 -3330
  17. package/docs/components/_template.md +37 -37
  18. package/docs/components/accession-label.md +106 -106
  19. package/docs/components/backdrop.md +83 -83
  20. package/docs/components/button-and-link.md +87 -87
  21. package/docs/components/callout.md +75 -75
  22. package/docs/components/code-block.md +109 -109
  23. package/docs/components/data-table.md +73 -73
  24. package/docs/components/figure.md +68 -68
  25. package/docs/components/heading-anchor.md +76 -76
  26. package/docs/components/icon.md +63 -63
  27. package/docs/components/ornament.md +77 -77
  28. package/docs/components/pagination.md +78 -78
  29. package/docs/components/post-list-item.md +91 -91
  30. package/docs/components/project-card.md +82 -82
  31. package/docs/components/prose.md +122 -122
  32. package/docs/components/site-footer.md +99 -99
  33. package/docs/components/site-header.md +133 -133
  34. package/docs/components/specimen-plate.md +92 -92
  35. package/docs/components/table-of-contents.md +83 -83
  36. package/docs/components/tag.md +70 -70
  37. package/docs/components/tooltip.md +67 -67
  38. package/docs/hugo.md +120 -120
  39. package/docs/syntax-highlighting.md +55 -55
  40. package/docs/templates.md +30 -30
  41. package/fonts/OFL-jetbrains-mono.txt +93 -93
  42. package/fonts/OFL-national-park.txt +93 -93
  43. package/fonts/OFL-yarndings-12.txt +93 -93
  44. package/icons/LICENSE +202 -202
  45. package/icons/manifest.json +75 -75
  46. package/layouts/_markup/render-blockquote.html +30 -30
  47. package/layouts/_markup/render-codeblock.html +18 -18
  48. package/layouts/_markup/render-heading.html +2 -2
  49. package/layouts/_markup/render-image.html +14 -14
  50. package/layouts/_markup/render-link.html +14 -14
  51. package/layouts/_markup/render-table.html +31 -31
  52. package/layouts/_partials/motifspec/accession/id.html +2 -2
  53. package/layouts/_partials/motifspec/accession/label.html +18 -18
  54. package/layouts/_partials/motifspec/accession/status.html +2 -2
  55. package/layouts/_partials/motifspec/article.html +24 -24
  56. package/layouts/_partials/motifspec/back-link.html +2 -2
  57. package/layouts/_partials/motifspec/body-end.html +5 -5
  58. package/layouts/_partials/motifspec/body-start.html +5 -5
  59. package/layouts/_partials/motifspec/figure.html +14 -14
  60. package/layouts/_partials/motifspec/filed-under.html +5 -5
  61. package/layouts/_partials/motifspec/h2s.html +7 -7
  62. package/layouts/_partials/motifspec/head.html +15 -15
  63. package/layouts/_partials/motifspec/pagination-entries.html +34 -34
  64. package/layouts/_partials/motifspec/pagination-pages.html +30 -30
  65. package/layouts/_partials/motifspec/post-list-item.html +15 -15
  66. package/layouts/_partials/motifspec/project-card.html +23 -23
  67. package/layouts/_partials/motifspec/section-heading.html +3 -3
  68. package/layouts/_partials/motifspec/site-header.html +27 -27
  69. package/layouts/_partials/motifspec/table-of-contents.html +21 -21
  70. package/layouts/_partials/motifspec/tag-filter.html +22 -22
  71. package/layouts/_partials/motifspec/tags.html +8 -8
  72. package/layouts/_partials/motifspec/tokens.html +9 -9
  73. package/package.json +68 -68
  74. package/scripts/check.mjs +153 -153
  75. package/scripts/lib.mjs +176 -176
  76. package/tokens/README.md +3 -3
  77. package/tokens/border.json +63 -63
  78. package/tokens/color.json +1902 -1902
  79. package/tokens/motion.json +207 -207
  80. package/tokens/radius.json +53 -53
  81. package/tokens/size.json +378 -378
  82. package/tokens/space.json +289 -289
  83. package/tokens/typography.json +859 -859
@@ -1,18 +1,18 @@
1
- {{- /* code-block.md: header bar (language, optional file, copy button revealed by codex.js) around Chroma's
2
- classed output. Breakout when a line is longer than the prose measure (size.measure.prose, in characters),
3
- as code-block.md asks. Use {file="path"} for a path. */ -}}
4
- {{- $lang := .Type | default "text" -}}
5
- {{- $measure := (index (partialCached "motifspec/tokens.html" "tokens") "size.measure.prose").value | replaceRE `[^0-9]` "" | int -}}
6
- {{- $long := false -}}
7
- {{- range split .Inner "\n" }}{{ if gt (strings.RuneCount .) $measure }}{{ $long = true }}{{ end }}{{ end -}}
8
- {{- $result := transform.HighlightCodeBlock . -}}
9
- <figure class="cx-code{{ if $long }} cx-code--breakout{{ end }}">
10
- <figcaption class="cx-code__bar">
11
- <span>{{ $lang }}</span>
12
- {{- with .Attributes.file }}
13
- <span class="cx-code__file">{{ . }}</span>
14
- {{- end }}
15
- <button class="cx-code__copy" type="button" hidden><svg class="cx-icon cx-icon--sm" aria-hidden="true" focusable="false"><use data-copy-icon href="#cx-icon-content-copy"></use></svg><span class="cx-code__copy-label">Copy</span></button>
16
- </figcaption>
17
- {{ replaceRE ` file="[^"]*"` "" (string $result.Wrapped) 1 | safeHTML }}
18
- </figure>
1
+ {{- /* code-block.md: header bar (language, optional file, copy button revealed by codex.js) around Chroma's
2
+ classed output. Breakout when a line is longer than the prose measure (size.measure.prose, in characters),
3
+ as code-block.md asks. Use {file="path"} for a path. */ -}}
4
+ {{- $lang := .Type | default "text" -}}
5
+ {{- $measure := (index (partialCached "motifspec/tokens.html" "tokens") "size.measure.prose").value | replaceRE `[^0-9]` "" | int -}}
6
+ {{- $long := false -}}
7
+ {{- range split .Inner "\n" }}{{ if gt (strings.RuneCount .) $measure }}{{ $long = true }}{{ end }}{{ end -}}
8
+ {{- $result := transform.HighlightCodeBlock . -}}
9
+ <figure class="cx-code{{ if $long }} cx-code--breakout{{ end }}">
10
+ <figcaption class="cx-code__bar">
11
+ <span>{{ $lang }}</span>
12
+ {{- with .Attributes.file }}
13
+ <span class="cx-code__file">{{ . }}</span>
14
+ {{- end }}
15
+ <button class="cx-code__copy" type="button" hidden><svg class="cx-icon cx-icon--sm" aria-hidden="true" focusable="false"><use data-copy-icon href="#cx-icon-content-copy"></use></svg><span class="cx-code__copy-label">Copy</span></button>
16
+ </figcaption>
17
+ {{ replaceRE ` file="[^"]*"` "" (string $result.Wrapped) 1 | safeHTML }}
18
+ </figure>
@@ -1,2 +1,2 @@
1
- {{- /* heading-anchor.md: every heading gets an id; h2s get the "#" anchor after a space. */ -}}
2
- <h{{ .Level }} id="{{ .Anchor }}">{{ .Text }}{{ if eq .Level 2 }} <a class="cx-anchor" href="#{{ .Anchor }}" aria-label="Link to {{ .PlainText }}">#</a>{{ end }}</h{{ .Level }}>
1
+ {{- /* heading-anchor.md: every heading gets an id; h2s get the "#" anchor after a space. */ -}}
2
+ <h{{ .Level }} id="{{ .Anchor }}">{{ .Text }}{{ if eq .Level 2 }} <a class="cx-anchor" href="#{{ .Anchor }}" aria-label="Link to {{ .PlainText }}">#</a>{{ end }}</h{{ .Level }}>
@@ -1,14 +1,14 @@
1
- {{- /* figure.md. A standalone image becomes a numbered figure: ![alt](file "caption"). On a page with a `hero` in front matter,
2
- the hero is Plate 1, so content plates start at 2. Inline images stay plain. Alt text is required.
3
- {width="prose"} on the line after a figure keeps it to the prose measure instead of breaking out. */ -}}
4
- {{- $img := .Page.Resources.Get .Destination -}}
5
- {{- if not $img }}{{ errorf "content/%s: image %q is not in the page bundle." .Page.File.Path .Destination }}{{ end -}}
6
- {{- if not .PlainText }}{{ errorf "content/%s: image %q has no alt text. Describe what the image shows (figure.md)." .Page.File.Path .Destination }}{{ end -}}
7
- {{- if .IsBlock -}}
8
- {{- if not .Title }}{{ errorf "content/%s: figure %q has no caption. Add one as the image title: ![alt](file \"what to notice\")." .Page.File.Path .Destination }}{{ end -}}
9
- {{- $first := cond (isset .Page.Params "hero") 2 1 -}}
10
- {{- partial "motifspec/figure.html" (dict "image" $img "alt" .PlainText "caption" (.Title | markdownify) "plate" (add .Ordinal $first) "prose" (eq (index .Attributes "width") "prose")) -}}
11
- {{- else -}}
12
- {{- $s := $img.Process "webp" -}}
13
- <img src="{{ $s.RelPermalink }}" alt="{{ .PlainText }}" width="{{ $s.Width }}" height="{{ $s.Height }}" loading="lazy" decoding="async">
14
- {{- end -}}
1
+ {{- /* figure.md. A standalone image becomes a numbered figure: ![alt](file "caption"). On a page with a `hero` in front matter,
2
+ the hero is Plate 1, so content plates start at 2. Inline images stay plain. Alt text is required.
3
+ {width="prose"} on the line after a figure keeps it to the prose measure instead of breaking out. */ -}}
4
+ {{- $img := .Page.Resources.Get .Destination -}}
5
+ {{- if not $img }}{{ errorf "content/%s: image %q is not in the page bundle." .Page.File.Path .Destination }}{{ end -}}
6
+ {{- if not .PlainText }}{{ errorf "content/%s: image %q has no alt text. Describe what the image shows (figure.md)." .Page.File.Path .Destination }}{{ end -}}
7
+ {{- if .IsBlock -}}
8
+ {{- if not .Title }}{{ errorf "content/%s: figure %q has no caption. Add one as the image title: ![alt](file \"what to notice\")." .Page.File.Path .Destination }}{{ end -}}
9
+ {{- $first := cond (isset .Page.Params "hero") 2 1 -}}
10
+ {{- partial "motifspec/figure.html" (dict "image" $img "alt" .PlainText "caption" (.Title | markdownify) "plate" (add .Ordinal $first) "prose" (eq (index .Attributes "width") "prose")) -}}
11
+ {{- else -}}
12
+ {{- $s := $img.Process "webp" -}}
13
+ <img src="{{ $s.RelPermalink }}" alt="{{ .PlainText }}" width="{{ $s.Width }}" height="{{ $s.Height }}" loading="lazy" decoding="async">
14
+ {{- end -}}
@@ -1,14 +1,14 @@
1
- {{- /* Links in prose. Internal page links are resolved (a broken one fails the build); links that leave the
2
- site get the arrow-outward icon after their text (site-footer.md, icon.md). */ -}}
3
- {{- $dest := .Destination -}}
4
- {{- $u := urls.Parse $dest -}}
5
- {{- $external := and $u.Host (ne $u.Host (urls.Parse site.BaseURL).Host) -}}
6
- {{- if and (not $u.Scheme) (not $u.Host) $u.Path -}}
7
- {{- with or (.Page.GetPage $u.Path) (site.GetPage $u.Path) -}}
8
- {{- $dest = printf "%s%s" .RelPermalink (cond (ne $u.Fragment "") (printf "#%s" $u.Fragment) "") -}}
9
- {{- else -}}
10
- {{- with $.Page.Resources.Get $u.Path }}{{ $dest = .RelPermalink }}{{ else }}{{ if not (hasPrefix $u.Path "/") }}{{ errorf "content/%s: link %q does not resolve to a page or bundle file." $.Page.File.Path $.Destination }}{{ end }}{{ end -}}
11
- {{- end -}}
12
- {{- end -}}
13
- <a href="{{ $dest | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }}{{ if $external }} rel="noopener"{{ end }}>{{ .Text }}{{ if $external }}<svg class="cx-icon cx-icon--sm" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-outward"></use></svg>{{ end }}</a>
14
- {{- /* chomp */ -}}
1
+ {{- /* Links in prose. Internal page links are resolved (a broken one fails the build); links that leave the
2
+ site get the arrow-outward icon after their text (site-footer.md, icon.md). */ -}}
3
+ {{- $dest := .Destination -}}
4
+ {{- $u := urls.Parse $dest -}}
5
+ {{- $external := and $u.Host (ne $u.Host (urls.Parse site.BaseURL).Host) -}}
6
+ {{- if and (not $u.Scheme) (not $u.Host) $u.Path -}}
7
+ {{- with or (.Page.GetPage $u.Path) (site.GetPage $u.Path) -}}
8
+ {{- $dest = printf "%s%s" .RelPermalink (cond (ne $u.Fragment "") (printf "#%s" $u.Fragment) "") -}}
9
+ {{- else -}}
10
+ {{- with $.Page.Resources.Get $u.Path }}{{ $dest = .RelPermalink }}{{ else }}{{ if not (hasPrefix $u.Path "/") }}{{ errorf "content/%s: link %q does not resolve to a page or bundle file." $.Page.File.Path $.Destination }}{{ end }}{{ end -}}
11
+ {{- end -}}
12
+ {{- end -}}
13
+ <a href="{{ $dest | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }}{{ if $external }} rel="noopener"{{ end }}>{{ .Text }}{{ if $external }}<svg class="cx-icon cx-icon--sm" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-outward"></use></svg>{{ end }}</a>
14
+ {{- /* chomp */ -}}
@@ -1,31 +1,31 @@
1
- {{- /* data-table.md: a focusable region named by its caption ({caption="…"} after the table; " | " becomes a
2
- separator), the first cell of each row as a row header, numeric or right-aligned columns marked is-num,
3
- and breakout above four columns. */ -}}
4
- {{- $file := printf "content/%s" .Page.File.Path -}}
5
- {{- $caption := .Attributes.caption -}}
6
- {{- if not $caption }}{{ errorf "%s: table %d has no caption. Add {caption=\"…\"} on the line after it (data-table.md)." $file (add .Ordinal 1) }}{{ end -}}
7
- {{- $id := printf "tbl-%s-%d" (.Page.File.ContentBaseName | urlize) .Ordinal -}}
8
- {{- $cols := 0 }}{{ range first 1 .THead }}{{ $cols = len . }}{{ end -}}
9
- {{- $num := slice -}}
10
- {{- range $c := seq 0 (sub $cols 1) -}}
11
- {{- $isNum := true -}}
12
- {{- range $.TBody }}{{ $cell := index . $c }}{{ if not (findRE `^[-+−]?[0-9][0-9.,]*(\s?[%×x])?$` (string $cell.Text | plainify | strings.TrimSpace)) }}{{ $isNum = false }}{{ end }}{{ end -}}
13
- {{- range first 1 $.THead }}{{ if eq (index . $c).Alignment "right" }}{{ $isNum = true }}{{ end }}{{ end -}}
14
- {{- $num = $num | append (and $isNum (gt $c 0)) -}}
15
- {{- end }}
16
- <div class="cx-table{{ if gt $cols 4 }} cx-table--breakout{{ end }}" role="region" aria-labelledby="{{ $id }}" tabindex="0">
17
- <table>
18
- <caption id="{{ $id }}">{{ replace (string $caption) " | " ` <span class="cx-sep" aria-hidden="true">|</span> ` | safeHTML }}</caption>
19
- <thead>
20
- {{- range .THead }}
21
- <tr>{{ range $i, $c := . }}<th scope="col"{{ if index $num $i }} class="is-num"{{ end }}>{{ $c.Text }}</th>{{ end }}</tr>
22
- {{- end }}
23
- </thead>
24
- <tbody>
25
- {{- range .TBody }}
26
- <tr>{{ range $i, $c := . }}{{ if eq $i 0 }}<th scope="row">{{ $c.Text }}</th>{{ else }}<td{{ if index $num $i }} class="is-num"{{ end }}>{{ $c.Text }}</td>{{ end }}{{ end }}</tr>
27
- {{- end }}
28
- </tbody>
29
- </table>
30
- </div>
31
- {{- /* chomp */ -}}
1
+ {{- /* data-table.md: a focusable region named by its caption ({caption="…"} after the table; " | " becomes a
2
+ separator), the first cell of each row as a row header, numeric or right-aligned columns marked is-num,
3
+ and breakout above four columns. */ -}}
4
+ {{- $file := printf "content/%s" .Page.File.Path -}}
5
+ {{- $caption := .Attributes.caption -}}
6
+ {{- if not $caption }}{{ errorf "%s: table %d has no caption. Add {caption=\"…\"} on the line after it (data-table.md)." $file (add .Ordinal 1) }}{{ end -}}
7
+ {{- $id := printf "tbl-%s-%d" (.Page.File.ContentBaseName | urlize) .Ordinal -}}
8
+ {{- $cols := 0 }}{{ range first 1 .THead }}{{ $cols = len . }}{{ end -}}
9
+ {{- $num := slice -}}
10
+ {{- range $c := seq 0 (sub $cols 1) -}}
11
+ {{- $isNum := true -}}
12
+ {{- range $.TBody }}{{ $cell := index . $c }}{{ if not (findRE `^[-+−]?[0-9][0-9.,]*(\s?[%×x])?$` (string $cell.Text | plainify | strings.TrimSpace)) }}{{ $isNum = false }}{{ end }}{{ end -}}
13
+ {{- range first 1 $.THead }}{{ if eq (index . $c).Alignment "right" }}{{ $isNum = true }}{{ end }}{{ end -}}
14
+ {{- $num = $num | append (and $isNum (gt $c 0)) -}}
15
+ {{- end }}
16
+ <div class="cx-table{{ if gt $cols 4 }} cx-table--breakout{{ end }}" role="region" aria-labelledby="{{ $id }}" tabindex="0">
17
+ <table>
18
+ <caption id="{{ $id }}">{{ replace (string $caption) " | " ` <span class="cx-sep" aria-hidden="true">|</span> ` | safeHTML }}</caption>
19
+ <thead>
20
+ {{- range .THead }}
21
+ <tr>{{ range $i, $c := . }}<th scope="col"{{ if index $num $i }} class="is-num"{{ end }}>{{ $c.Text }}</th>{{ end }}</tr>
22
+ {{- end }}
23
+ </thead>
24
+ <tbody>
25
+ {{- range .TBody }}
26
+ <tr>{{ range $i, $c := . }}{{ if eq $i 0 }}<th scope="row">{{ $c.Text }}</th>{{ else }}<td{{ if index $num $i }} class="is-num"{{ end }}>{{ $c.Text }}</td>{{ end }}{{ end }}</tr>
27
+ {{- end }}
28
+ </tbody>
29
+ </table>
30
+ </div>
31
+ {{- /* chomp */ -}}
@@ -1,2 +1,2 @@
1
- {{- /* accession-label.md, compact form for meta lines: number, date, reading time. Context: a page. */ -}}
2
- <p class="cx-id"><span class="cx-id__no">{{ .Params.accession }}</span><time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "2006-01-02" }}</time><span>{{ .ReadingTime }} min read</span></p>
1
+ {{- /* accession-label.md, compact form for meta lines: number, date, reading time. Context: a page. */ -}}
2
+ <p class="cx-id"><span class="cx-id__no">{{ .Params.accession }}</span><time datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "2006-01-02" }}</time><span>{{ .ReadingTime }} min read</span></p>
@@ -1,18 +1,18 @@
1
- {{- /* accession-label.md, full form: number first, then date, then everything else.
2
- Context: dict "page" and "variant": "lead" (above the title; role and stack are __detail fields, which a phone
3
- hides) or "card" (after the article; the full label, shown only on a phone). */ -}}
4
- {{- $p := .page -}}
5
- {{- $lead := eq .variant "lead" -}}
6
- <dl class="cx-label cx-label--{{ .variant }}" aria-label="Accession label">
7
- <div class="cx-label__id"><dt>No.</dt><dd>{{ $p.Params.accession }}</dd></div>
8
- <div><dt>Filed</dt><dd><time datetime="{{ $p.Date.Format "2006-01-02" }}">{{ $p.Date.Format "2006-01-02" }}</time></dd></div>
9
- {{- with $p.Params.role }}
10
- <div{{ if $lead }} class="cx-label__detail"{{ end }}><dt>Role</dt><dd>{{ . }}</dd></div>
11
- {{- end }}
12
- {{- with $p.Params.stack }}
13
- <div{{ if $lead }} class="cx-label__detail"{{ end }}><dt>Stack</dt><dd>{{ range $i, $s := . }}{{ if $i }} <span class="cx-sep" aria-hidden="true">|</span> {{ end }}{{ $s }}{{ end }}</dd></div>
14
- {{- end }}
15
- {{- with $p.Params.status }}
16
- <div><dt>Status</dt><dd>{{ partial "motifspec/accession/status.html" . }}</dd></div>
17
- {{- end }}
18
- </dl>
1
+ {{- /* accession-label.md, full form: number first, then date, then everything else.
2
+ Context: dict "page" and "variant": "lead" (above the title; role and stack are __detail fields, which a phone
3
+ hides) or "card" (after the article; the full label, shown only on a phone). */ -}}
4
+ {{- $p := .page -}}
5
+ {{- $lead := eq .variant "lead" -}}
6
+ <dl class="cx-label cx-label--{{ .variant }}" aria-label="Accession label">
7
+ <div class="cx-label__id"><dt>No.</dt><dd>{{ $p.Params.accession }}</dd></div>
8
+ <div><dt>Filed</dt><dd><time datetime="{{ $p.Date.Format "2006-01-02" }}">{{ $p.Date.Format "2006-01-02" }}</time></dd></div>
9
+ {{- with $p.Params.role }}
10
+ <div{{ if $lead }} class="cx-label__detail"{{ end }}><dt>Role</dt><dd>{{ . }}</dd></div>
11
+ {{- end }}
12
+ {{- with $p.Params.stack }}
13
+ <div{{ if $lead }} class="cx-label__detail"{{ end }}><dt>Stack</dt><dd>{{ range $i, $s := . }}{{ if $i }} <span class="cx-sep" aria-hidden="true">|</span> {{ end }}{{ $s }}{{ end }}</dd></div>
14
+ {{- end }}
15
+ {{- with $p.Params.status }}
16
+ <div><dt>Status</dt><dd>{{ partial "motifspec/accession/status.html" . }}</dd></div>
17
+ {{- end }}
18
+ </dl>
@@ -1,2 +1,2 @@
1
- {{- /* cx-status: a dot plus a word, never colour alone. Context: live | building | archived. */ -}}
2
- <span class="cx-status cx-status--{{ . }}">{{ . | strings.FirstUpper }}</span>
1
+ {{- /* cx-status: a dot plus a word, never colour alone. Context: live | building | archived. */ -}}
2
+ <span class="cx-status cx-status--{{ . }}">{{ . | strings.FirstUpper }}</span>
@@ -1,24 +1,24 @@
1
- {{- /* The cx-article layout: TOC before the main column in the DOM, then prose ending in the flower end mark.
2
- Context: dict "page" "toc" (always | auto). auto shows the TOC when the content has three or more h2s
3
- (table-of-contents.md); a case study passes always. */ -}}
4
- {{- $p := .page -}}
5
- {{- $h2s := partial "motifspec/h2s.html" $p -}}
6
- {{- $toc := or (eq .toc "always") (ge (len $h2s) 3) -}}
7
- {{- if and (eq .toc "always") (lt (len $h2s) 1) }}{{ errorf "content/%s: toc \"always\" needs h2 sections to list (table-of-contents.md)." $p.File.Path }}{{ end -}}
8
- {{- /* ornament.md: the flower ("g") goes after the last sentence, so the content must end with a paragraph. */ -}}
9
- {{- $content := $p.Content | strings.TrimSpace -}}
10
- {{- if gt (len (findRE `class="cx-callout[ "]` $content)) 2 }}{{ errorf "content/%s: more than two callouts in one article; they lose force when repeated (callout.md)." $p.File.Path }}{{ end -}}
11
- {{- $endMark := `<span class="cx-end-mark" aria-hidden="true">g</span></p>` -}}
12
- {{- if strings.HasSuffix $content "</p>" -}}
13
- {{- $content = printf "%s%s" (strings.TrimSuffix "</p>" $content) $endMark -}}
14
- {{- else -}}
15
- {{- warnf "content/%s: the article should end with a paragraph so the end mark follows the last sentence." $p.File.Path -}}
16
- {{- end }}
17
- <div class="cx-article">
18
- {{- if $toc }}
19
- {{ partial "motifspec/table-of-contents.html" $p }}
20
- {{- end }}
21
- <div class="cx-article__main cx-prose">
22
- {{ $content | safeHTML }}
23
- </div>
24
- </div>
1
+ {{- /* The cx-article layout: TOC before the main column in the DOM, then prose ending in the flower end mark.
2
+ Context: dict "page" "toc" (always | auto). auto shows the TOC when the content has three or more h2s
3
+ (table-of-contents.md); a case study passes always. */ -}}
4
+ {{- $p := .page -}}
5
+ {{- $h2s := partial "motifspec/h2s.html" $p -}}
6
+ {{- $toc := or (eq .toc "always") (ge (len $h2s) 3) -}}
7
+ {{- if and (eq .toc "always") (lt (len $h2s) 1) }}{{ errorf "content/%s: toc \"always\" needs h2 sections to list (table-of-contents.md)." $p.File.Path }}{{ end -}}
8
+ {{- /* ornament.md: the flower ("g") goes after the last sentence, so the content must end with a paragraph. */ -}}
9
+ {{- $content := $p.Content | strings.TrimSpace -}}
10
+ {{- if gt (len (findRE `class="cx-callout[ "]` $content)) 2 }}{{ errorf "content/%s: more than two callouts in one article; they lose force when repeated (callout.md)." $p.File.Path }}{{ end -}}
11
+ {{- $endMark := `<span class="cx-end-mark" aria-hidden="true">g</span></p>` -}}
12
+ {{- if strings.HasSuffix $content "</p>" -}}
13
+ {{- $content = printf "%s%s" (strings.TrimSuffix "</p>" $content) $endMark -}}
14
+ {{- else -}}
15
+ {{- warnf "content/%s: the article should end with a paragraph so the end mark follows the last sentence." $p.File.Path -}}
16
+ {{- end }}
17
+ <div class="cx-article">
18
+ {{- if $toc }}
19
+ {{ partial "motifspec/table-of-contents.html" $p }}
20
+ {{- end }}
21
+ <div class="cx-article__main cx-prose">
22
+ {{ $content | safeHTML }}
23
+ </div>
24
+ </div>
@@ -1,2 +1,2 @@
1
- {{- /* button-and-link.md, back link. Context: dict "href" "label". */ -}}
2
- <a class="cx-back" href="{{ .href }}"><svg class="cx-icon cx-icon--sm cx-button__arrow" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-back"></use></svg>{{ .label }}</a>
1
+ {{- /* button-and-link.md, back link. Context: dict "href" "label". */ -}}
2
+ <a class="cx-back" href="{{ .href }}"><svg class="cx-icon cx-icon--sm cx-button__arrow" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-back"></use></svg>{{ .label }}</a>
@@ -1,5 +1,5 @@
1
- {{- /* docs/hugo.md. Call last inside <body>: drifts the backdrop and reveals the header's pause control. Without it
2
- the contours stay still. */ -}}
3
- {{- with resources.Get "motifspec/plate.js" | minify | fingerprint }}
4
- <script src="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous" defer></script>
5
- {{- end }}
1
+ {{- /* docs/hugo.md. Call last inside <body>: drifts the backdrop and reveals the header's pause control. Without it
2
+ the contours stay still. */ -}}
3
+ {{- with resources.Get "motifspec/plate.js" | minify | fingerprint }}
4
+ <script src="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous" defer></script>
5
+ {{- end }}
@@ -1,5 +1,5 @@
1
- {{- /* docs/hugo.md. Call first inside <body class="cx-backdrop-page">: the contour backdrop (backdrop.md), the icon
2
- sprite (icon.md), once, before anything that uses it, and the skip link to <main id="main">. */ -}}
3
- {{ with resources.Get "motifspec/backdrop.html" }}{{ .Content | safeHTML }}{{ else }}{{ errorf "motifspec/backdrop.html is missing: is the MotifSpec module imported?" }}{{ end }}
4
- <div hidden>{{ with resources.Get "motifspec/icons.svg" }}{{ .Content | safeHTML }}{{ end }}</div>
5
- <a class="cx-skip-link" href="#main">Skip to content</a>
1
+ {{- /* docs/hugo.md. Call first inside <body class="cx-backdrop-page">: the contour backdrop (backdrop.md), the icon
2
+ sprite (icon.md), once, before anything that uses it, and the skip link to <main id="main">. */ -}}
3
+ {{ with resources.Get "motifspec/backdrop.html" }}{{ .Content | safeHTML }}{{ else }}{{ errorf "motifspec/backdrop.html is missing: is the MotifSpec module imported?" }}{{ end }}
4
+ <div hidden>{{ with resources.Get "motifspec/icons.svg" }}{{ .Content | safeHTML }}{{ end }}</div>
5
+ <a class="cx-skip-link" href="#main">Skip to content</a>
@@ -1,14 +1,14 @@
1
- {{- /* figure.md for a raster image from the page bundle: WebP at two widths, explicit width and height, and a
2
- numbered plate in the caption. Context: dict "image" (resource) "alt" "caption" (HTML) "plate" (number)
3
- "eager" (true for the case-study hero, the likely largest paint) "prose" (true to keep the figure to the prose
4
- measure instead of breaking out, for a supporting image). */ -}}
5
- {{- $img := .image -}}
6
- {{- $w := cond (gt $img.Width 1600) 1600 $img.Width -}}
7
- {{- $large := $img.Process (printf "resize %dx webp" $w) -}}
8
- {{- $small := $img.Process (printf "resize %dx webp" (div $w 2)) -}}
9
- <figure class="cx-figure{{ if not .prose }} cx-figure--breakout{{ end }}">
10
- <div class="cx-figure__frame">
11
- <img src="{{ $large.RelPermalink }}" srcset="{{ $small.RelPermalink }} {{ $small.Width }}w, {{ $large.RelPermalink }} {{ $large.Width }}w" alt="{{ .alt }}" width="{{ $large.Width }}" height="{{ $large.Height }}"{{ if .eager }} fetchpriority="high"{{ else }} loading="lazy"{{ end }} decoding="async">
12
- </div>
13
- <figcaption><span class="cx-figure__plate">Plate {{ .plate }}</span>{{ .caption }}</figcaption>
14
- </figure>
1
+ {{- /* figure.md for a raster image from the page bundle: WebP at two widths, explicit width and height, and a
2
+ numbered plate in the caption. Context: dict "image" (resource) "alt" "caption" (HTML) "plate" (number)
3
+ "eager" (true for the case-study hero, the likely largest paint) "prose" (true to keep the figure to the prose
4
+ measure instead of breaking out, for a supporting image). */ -}}
5
+ {{- $img := .image -}}
6
+ {{- $w := cond (gt $img.Width 1600) 1600 $img.Width -}}
7
+ {{- $large := $img.Process (printf "resize %dx webp" $w) -}}
8
+ {{- $small := $img.Process (printf "resize %dx webp" (div $w 2)) -}}
9
+ <figure class="cx-figure{{ if not .prose }} cx-figure--breakout{{ end }}">
10
+ <div class="cx-figure__frame">
11
+ <img src="{{ $large.RelPermalink }}" srcset="{{ $small.RelPermalink }} {{ $small.Width }}w, {{ $large.RelPermalink }} {{ $large.Width }}w" alt="{{ .alt }}" width="{{ $large.Width }}" height="{{ $large.Height }}"{{ if .eager }} fetchpriority="high"{{ else }} loading="lazy"{{ end }} decoding="async">
12
+ </div>
13
+ <figcaption><span class="cx-figure__plate">Plate {{ .plate }}</span>{{ .caption }}</figcaption>
14
+ </figure>
@@ -1,5 +1,5 @@
1
- {{- /* The "Filed under" tags after an article (docs/templates.md, tag.md). Context: a page. */ -}}
2
- <div class="cx-stack">
3
- <p class="cx-eyebrow">Filed under</p>
4
- {{ partial "motifspec/tags.html" (dict "page" . "max" 5) }}
5
- </div>
1
+ {{- /* The "Filed under" tags after an article (docs/templates.md, tag.md). Context: a page. */ -}}
2
+ <div class="cx-stack">
3
+ <p class="cx-eyebrow">Filed under</p>
4
+ {{ partial "motifspec/tags.html" (dict "page" . "max" 5) }}
5
+ </div>
@@ -1,7 +1,7 @@
1
- {{- /* The content's h2 headings (with their h3 children) from Hugo's fragments tree. Content starts at h2, so
2
- the tree's top level is a placeholder for the missing h1; step down to the first level that has an h2. */ -}}
3
- {{- $out := slice -}}
4
- {{- range .Fragments.Headings -}}
5
- {{- if eq .Level 2 }}{{ $out = $out | append . }}{{ else }}{{ range .Headings }}{{ if eq .Level 2 }}{{ $out = $out | append . }}{{ end }}{{ end }}{{ end -}}
6
- {{- end -}}
7
- {{- return $out -}}
1
+ {{- /* The content's h2 headings (with their h3 children) from Hugo's fragments tree. Content starts at h2, so
2
+ the tree's top level is a placeholder for the missing h1; step down to the first level that has an h2. */ -}}
3
+ {{- $out := slice -}}
4
+ {{- range .Fragments.Headings -}}
5
+ {{- if eq .Level 2 }}{{ $out = $out | append . }}{{ else }}{{ range .Headings }}{{ if eq .Level 2 }}{{ $out = $out | append . }}{{ end }}{{ end }}{{ end -}}
6
+ {{- end -}}
7
+ {{- return $out -}}
@@ -1,15 +1,15 @@
1
- {{- /* docs/hugo.md. Call inside <head>: the theme snippet, font preloads, the stylesheet and the behaviour script.
2
- Order matters: the theme snippet runs before the stylesheet is parsed, so a stored theme is on <html> before
3
- first paint. Everything is self-hosted from this module. */ -}}
4
- {{- with resources.Get "motifspec/theme-init.js" }}
5
- <script>{{ .Content | safeJS }}</script>
6
- {{- else }}{{ errorf "motifspec/theme-init.js is missing: is the MotifSpec module imported?" }}{{ end }}
7
- <link rel="preload" href="/fonts/national-park-latin-wght.woff2" as="font" type="font/woff2" crossorigin>
8
- <link rel="preload" href="/fonts/yarndings-12-latin.woff2" as="font" type="font/woff2" crossorigin>
9
- {{- /* Published at /motifspec/…: one level below the root, so the stylesheet's ../fonts/ URLs reach /fonts/. */}}
10
- {{- with resources.Get "motifspec/codex.css" | minify | fingerprint }}
11
- <link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
12
- {{- end }}
13
- {{- with resources.Get "motifspec/codex.js" | minify | fingerprint }}
14
- <script src="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous" defer></script>
15
- {{- end }}
1
+ {{- /* docs/hugo.md. Call inside <head>: the theme snippet, font preloads, the stylesheet and the behaviour script.
2
+ Order matters: the theme snippet runs before the stylesheet is parsed, so a stored theme is on <html> before
3
+ first paint. Everything is self-hosted from this module. */ -}}
4
+ {{- with resources.Get "motifspec/theme-init.js" }}
5
+ <script>{{ .Content | safeJS }}</script>
6
+ {{- else }}{{ errorf "motifspec/theme-init.js is missing: is the MotifSpec module imported?" }}{{ end }}
7
+ <link rel="preload" href="/fonts/national-park-latin-wght.woff2" as="font" type="font/woff2" crossorigin>
8
+ <link rel="preload" href="/fonts/yarndings-12-latin.woff2" as="font" type="font/woff2" crossorigin>
9
+ {{- /* Published at /motifspec/…: one level below the root, so the stylesheet's ../fonts/ URLs reach /fonts/. */}}
10
+ {{- with resources.Get "motifspec/codex.css" | minify | fingerprint }}
11
+ <link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
12
+ {{- end }}
13
+ {{- with resources.Get "motifspec/codex.js" | minify | fingerprint }}
14
+ <script src="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous" defer></script>
15
+ {{- end }}
@@ -1,34 +1,34 @@
1
- {{- /* pagination.md between entries of one collection, oldest = 1. Previous is the older entry, Next the newer.
2
- A missing direction stays as a disabled cell. Context: dict "page" "label" ("Post navigation") "noun" ("Post"). */ -}}
3
- {{- $p := .page -}}
4
- {{- $all := (where site.RegularPages "Section" $p.Section).ByDate -}}
5
- {{- $at := 0 }}{{ range $i, $e := $all }}{{ if eq $e.RelPermalink $p.RelPermalink }}{{ $at = $i }}{{ end }}{{ end -}}
6
- {{- $prev := cond (gt $at 0) (index $all (sub $at 1)) nil -}}
7
- {{- $next := cond (lt (add $at 1) (len $all)) (index $all (add $at 1)) nil -}}
8
- {{- if gt (len $all) 1 }}
9
- <nav class="cx-pagination" aria-label="{{ .label }}">
10
- {{- with $prev }}
11
- <a class="cx-pagination__link" href="{{ .RelPermalink }}" rel="prev">
12
- <span class="cx-pagination__dir"><svg class="cx-icon cx-icon--sm cx-button__arrow" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-back"></use></svg>Previous</span>
13
- <span class="cx-pagination__title">{{ .Title }}</span>
14
- </a>
15
- {{- else }}
16
- <span class="cx-pagination__link" rel="prev" aria-disabled="true">
17
- <span class="cx-pagination__dir"><svg class="cx-icon cx-icon--sm cx-button__arrow" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-back"></use></svg>Previous</span>
18
- <span class="cx-pagination__title">First entry</span>
19
- </span>
20
- {{- end }}
21
- <p class="cx-pagination__status">{{ .noun }}<strong>{{ add $at 1 }} / {{ len $all }}</strong></p>
22
- {{- with $next }}
23
- <a class="cx-pagination__link" href="{{ .RelPermalink }}" rel="next">
24
- <span class="cx-pagination__dir">Next<svg class="cx-icon cx-icon--sm cx-button__arrow" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-forward"></use></svg></span>
25
- <span class="cx-pagination__title">{{ .Title }}</span>
26
- </a>
27
- {{- else }}
28
- <span class="cx-pagination__link" rel="next" aria-disabled="true">
29
- <span class="cx-pagination__dir">Next<svg class="cx-icon cx-icon--sm cx-button__arrow" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-forward"></use></svg></span>
30
- <span class="cx-pagination__title">Latest entry</span>
31
- </span>
32
- {{- end }}
33
- </nav>
34
- {{- end -}}
1
+ {{- /* pagination.md between entries of one collection, oldest = 1. Previous is the older entry, Next the newer.
2
+ A missing direction stays as a disabled cell. Context: dict "page" "label" ("Post navigation") "noun" ("Post"). */ -}}
3
+ {{- $p := .page -}}
4
+ {{- $all := (where site.RegularPages "Section" $p.Section).ByDate -}}
5
+ {{- $at := 0 }}{{ range $i, $e := $all }}{{ if eq $e.RelPermalink $p.RelPermalink }}{{ $at = $i }}{{ end }}{{ end -}}
6
+ {{- $prev := cond (gt $at 0) (index $all (sub $at 1)) nil -}}
7
+ {{- $next := cond (lt (add $at 1) (len $all)) (index $all (add $at 1)) nil -}}
8
+ {{- if gt (len $all) 1 }}
9
+ <nav class="cx-pagination" aria-label="{{ .label }}">
10
+ {{- with $prev }}
11
+ <a class="cx-pagination__link" href="{{ .RelPermalink }}" rel="prev">
12
+ <span class="cx-pagination__dir"><svg class="cx-icon cx-icon--sm cx-button__arrow" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-back"></use></svg>Previous</span>
13
+ <span class="cx-pagination__title">{{ .Title }}</span>
14
+ </a>
15
+ {{- else }}
16
+ <span class="cx-pagination__link" rel="prev" aria-disabled="true">
17
+ <span class="cx-pagination__dir"><svg class="cx-icon cx-icon--sm cx-button__arrow" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-back"></use></svg>Previous</span>
18
+ <span class="cx-pagination__title">First entry</span>
19
+ </span>
20
+ {{- end }}
21
+ <p class="cx-pagination__status">{{ .noun }}<strong>{{ add $at 1 }} / {{ len $all }}</strong></p>
22
+ {{- with $next }}
23
+ <a class="cx-pagination__link" href="{{ .RelPermalink }}" rel="next">
24
+ <span class="cx-pagination__dir">Next<svg class="cx-icon cx-icon--sm cx-button__arrow" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-forward"></use></svg></span>
25
+ <span class="cx-pagination__title">{{ .Title }}</span>
26
+ </a>
27
+ {{- else }}
28
+ <span class="cx-pagination__link" rel="next" aria-disabled="true">
29
+ <span class="cx-pagination__dir">Next<svg class="cx-icon cx-icon--sm cx-button__arrow" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-forward"></use></svg></span>
30
+ <span class="cx-pagination__title">Latest entry</span>
31
+ </span>
32
+ {{- end }}
33
+ </nav>
34
+ {{- end -}}
@@ -1,30 +1,30 @@
1
- {{- /* pagination.md below a paginated index: "Page 2 / 5", with Newer and Older in place of titles.
2
- Context: dict "pager" "label". Renders nothing when everything fits on one page. */ -}}
3
- {{- $pg := .pager -}}
4
- {{- if gt $pg.TotalPages 1 }}
5
- <nav class="cx-pagination" aria-label="{{ .label }}">
6
- {{- if $pg.HasPrev }}
7
- <a class="cx-pagination__link" href="{{ $pg.Prev.URL }}" rel="prev">
8
- <span class="cx-pagination__dir"><svg class="cx-icon cx-icon--sm cx-button__arrow" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-back"></use></svg>Previous</span>
9
- <span class="cx-pagination__title">Newer</span>
10
- </a>
11
- {{- else }}
12
- <span class="cx-pagination__link" rel="prev" aria-disabled="true">
13
- <span class="cx-pagination__dir"><svg class="cx-icon cx-icon--sm cx-button__arrow" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-back"></use></svg>Previous</span>
14
- <span class="cx-pagination__title">Newest page</span>
15
- </span>
16
- {{- end }}
17
- <p class="cx-pagination__status">Page<strong>{{ $pg.PageNumber }} / {{ $pg.TotalPages }}</strong></p>
18
- {{- if $pg.HasNext }}
19
- <a class="cx-pagination__link" href="{{ $pg.Next.URL }}" rel="next">
20
- <span class="cx-pagination__dir">Next<svg class="cx-icon cx-icon--sm cx-button__arrow" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-forward"></use></svg></span>
21
- <span class="cx-pagination__title">Older</span>
22
- </a>
23
- {{- else }}
24
- <span class="cx-pagination__link" rel="next" aria-disabled="true">
25
- <span class="cx-pagination__dir">Next<svg class="cx-icon cx-icon--sm cx-button__arrow" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-forward"></use></svg></span>
26
- <span class="cx-pagination__title">Oldest page</span>
27
- </span>
28
- {{- end }}
29
- </nav>
30
- {{- end -}}
1
+ {{- /* pagination.md below a paginated index: "Page 2 / 5", with Newer and Older in place of titles.
2
+ Context: dict "pager" "label". Renders nothing when everything fits on one page. */ -}}
3
+ {{- $pg := .pager -}}
4
+ {{- if gt $pg.TotalPages 1 }}
5
+ <nav class="cx-pagination" aria-label="{{ .label }}">
6
+ {{- if $pg.HasPrev }}
7
+ <a class="cx-pagination__link" href="{{ $pg.Prev.URL }}" rel="prev">
8
+ <span class="cx-pagination__dir"><svg class="cx-icon cx-icon--sm cx-button__arrow" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-back"></use></svg>Previous</span>
9
+ <span class="cx-pagination__title">Newer</span>
10
+ </a>
11
+ {{- else }}
12
+ <span class="cx-pagination__link" rel="prev" aria-disabled="true">
13
+ <span class="cx-pagination__dir"><svg class="cx-icon cx-icon--sm cx-button__arrow" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-back"></use></svg>Previous</span>
14
+ <span class="cx-pagination__title">Newest page</span>
15
+ </span>
16
+ {{- end }}
17
+ <p class="cx-pagination__status">Page<strong>{{ $pg.PageNumber }} / {{ $pg.TotalPages }}</strong></p>
18
+ {{- if $pg.HasNext }}
19
+ <a class="cx-pagination__link" href="{{ $pg.Next.URL }}" rel="next">
20
+ <span class="cx-pagination__dir">Next<svg class="cx-icon cx-icon--sm cx-button__arrow" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-forward"></use></svg></span>
21
+ <span class="cx-pagination__title">Older</span>
22
+ </a>
23
+ {{- else }}
24
+ <span class="cx-pagination__link" rel="next" aria-disabled="true">
25
+ <span class="cx-pagination__dir">Next<svg class="cx-icon cx-icon--sm cx-button__arrow" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-forward"></use></svg></span>
26
+ <span class="cx-pagination__title">Oldest page</span>
27
+ </span>
28
+ {{- end }}
29
+ </nav>
30
+ {{- end -}}
@@ -1,15 +1,15 @@
1
- {{- /* post-list-item.md: number, date and reading time beside the title, summary and tags. Context: dict "page" "level". */ -}}
2
- {{- $p := .page -}}
3
- {{- $h := .level | default 3 -}}
4
- <li class="cx-post">
5
- <p class="cx-post__meta">
6
- <span class="cx-id__no">{{ $p.Params.accession }}</span>
7
- <time datetime="{{ $p.Date.Format "2006-01-02" }}">{{ $p.Date.Format "2006-01-02" }}</time>
8
- <span>{{ $p.ReadingTime }} min</span>
9
- </p>
10
- <div class="cx-post__main">
11
- <h{{ $h }} class="cx-post__title"><a href="{{ $p.RelPermalink }}">{{ $p.Title }}</a></h{{ $h }}>
12
- <p class="cx-post__summary">{{ $p.Summary | plainify }}</p>
13
- {{- partial "motifspec/tags.html" (dict "page" $p "max" 5) }}
14
- </div>
15
- </li>
1
+ {{- /* post-list-item.md: number, date and reading time beside the title, summary and tags. Context: dict "page" "level". */ -}}
2
+ {{- $p := .page -}}
3
+ {{- $h := .level | default 3 -}}
4
+ <li class="cx-post">
5
+ <p class="cx-post__meta">
6
+ <span class="cx-id__no">{{ $p.Params.accession }}</span>
7
+ <time datetime="{{ $p.Date.Format "2006-01-02" }}">{{ $p.Date.Format "2006-01-02" }}</time>
8
+ <span>{{ $p.ReadingTime }} min</span>
9
+ </p>
10
+ <div class="cx-post__main">
11
+ <h{{ $h }} class="cx-post__title"><a href="{{ $p.RelPermalink }}">{{ $p.Title }}</a></h{{ $h }}>
12
+ <p class="cx-post__summary">{{ $p.Summary | plainify }}</p>
13
+ {{- partial "motifspec/tags.html" (dict "page" $p "max" 5) }}
14
+ </div>
15
+ </li>