@aitrien/motifspec 1.20.0 → 1.20.1
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/CHANGELOG.md +10 -0
- package/README.md +1 -0
- package/dist/codex.css +4 -1
- package/dist/tokens.css +1 -1
- package/dist/tokens.js +1 -1
- package/dist/tokens.json +1 -1
- package/docs/components/page-footer.md +25 -6
- package/docs/foundations/colour.md +19 -0
- package/docs/foundations/icons.md +13 -0
- package/docs/foundations/motion.md +14 -0
- package/docs/foundations/ornaments.md +21 -0
- package/docs/foundations/space-and-size.md +26 -0
- package/docs/foundations/type.md +22 -0
- package/docs/hugo.md +2 -2
- package/docs/reference/checker-rules.md +13 -0
- package/docs/reference/contrast.md +18 -0
- package/docs/reference/tokens.md +14 -0
- package/layouts/_partials/motifspec/page-footer.html +32 -17
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Every release of MotifSpec (named brand-codex until 1.10.0), newest first. Entries before 1.10.0 keep the names they were released under. Versions follow the rules in `CONVENTIONS.md`: renaming or removing a semantic token is major, adding tokens, components or icons is minor, and changing a value or fixing a description is a patch. `npm run build` fails if the version in `package.json` has no entry here.
|
|
4
4
|
|
|
5
|
+
## [1.20.1] - 2026-11-05
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
- The page footer links to a page's source with **View source**, given `params.motifspec.sourceURL` (the repository's address for viewing files). `editURL` still gives Edit this page. A page made from one section of a file opens at that heading (its `sourceAnchor` param), where an editor would open at the top of the file. A page's `data` param, the files its generated tables come from, shows as "Generated from" after the date, and `page-footer.md` lists the params.
|
|
9
|
+
- motifspec.com's pages about the tokens, icons and checker rules keep their wording in Markdown in `docs/foundations/` and `docs/reference/`, with a visible line such as "*Generated from `tokens/color.json`: the palette.*" where each table goes. View source opens that file, and the footer names the data. The build fails if a line names the wrong files or an element no page shows.
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
- motifspec.com's Type page showed "[object Object]" after the weight, leading and tracking table, from a misplaced bracket in the generator, and that table didn't widen like the others.
|
|
13
|
+
- On motifspec.com, Edit this page opened the whole README for pages made from one of its sections, and a data file for pages whose wording was in the generator. View source now opens the section, or the file with all of the page's wording.
|
|
14
|
+
|
|
5
15
|
## [1.20.0] - 2026-11-05
|
|
6
16
|
|
|
7
17
|
### Added
|
package/README.md
CHANGED
|
@@ -160,6 +160,7 @@ icons/ Approved Material Symbols (manifest.json, source SVGs, Apach
|
|
|
160
160
|
docs/components/ One rule file per component (front-matter token lists generated from the CSS)
|
|
161
161
|
docs/layouts/ One file per layout: shell, page templates, components, decoration, headings, stack
|
|
162
162
|
docs/hugo.md The Hugo partials and render hooks, their contexts and the front matter they read
|
|
163
|
+
docs/foundations/, docs/reference/ The wording of motifspec.com's pages about the tokens, icons and checker rules; their tables are generated
|
|
163
164
|
layouts/ Hugo partials (_partials/motifspec/) and Markdown render hooks (_markup/), mounted by the module
|
|
164
165
|
docs/syntax-highlighting.md
|
|
165
166
|
fonts/ Self-hosted WOFF2 (Latin subsets) and their OFL licences
|
package/dist/codex.css
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/jetbrains-mono-latin-wght.woff2") format("woff2"); font-weight: 100 800; font-style: normal; font-display: swap; }
|
|
3
3
|
@font-face { font-family: "Yarndings 12"; src: url("../fonts/yarndings-12-latin.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: block; }
|
|
4
4
|
|
|
5
|
-
/* MotifSpec 1.20.
|
|
5
|
+
/* MotifSpec 1.20.1 — generated from tokens/*.json. Do not edit.
|
|
6
6
|
Themes: semantic colours use light-dark(); color-scheme follows the system unless
|
|
7
7
|
<html data-theme="light|dark"> pins it. --cx-primitive-* are for this file only. */
|
|
8
8
|
:root {
|
|
@@ -608,6 +608,9 @@ p, li, dd, figcaption { text-wrap: pretty; }
|
|
|
608
608
|
border-top: var(--cx-border-width-hairline) solid var(--cx-color-border-subtle);
|
|
609
609
|
}
|
|
610
610
|
.cx-page-footer .cx-meta { margin: 0; }
|
|
611
|
+
/* The files a page's generated tables come from: inline links, as in prose. */
|
|
612
|
+
.cx-page-footer .cx-meta a { color: var(--cx-color-link-rest); text-decoration-thickness: var(--cx-border-width-hairline); text-underline-offset: var(--cx-space-inline-xs); }
|
|
613
|
+
.cx-page-footer .cx-meta a:hover { color: var(--cx-color-link-hover); text-decoration-thickness: var(--cx-border-width-emphasis); }
|
|
611
614
|
|
|
612
615
|
/* ------------------------------------------------------------ search (a dialog over the page, from the header) */
|
|
613
616
|
.cx-search-trigger {
|
package/dist/tokens.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* MotifSpec 1.20.
|
|
1
|
+
/* MotifSpec 1.20.1 — generated from tokens/*.json. Do not edit.
|
|
2
2
|
Themes: semantic colours use light-dark(); color-scheme follows the system unless
|
|
3
3
|
<html data-theme="light|dark"> pins it. --cx-primitive-* are for this file only. */
|
|
4
4
|
:root {
|
package/dist/tokens.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Generated by npm run build. Do not edit.
|
|
2
|
-
export const version = "1.20.
|
|
2
|
+
export const version = "1.20.1";
|
|
3
3
|
export const changelog = "https://github.com/Aitrien/motifspec/blob/main/CHANGELOG.md";
|
|
4
4
|
export const showcase = "https://motifspec.com";
|
|
5
5
|
export const tokens = [
|
package/dist/tokens.json
CHANGED
|
@@ -3,9 +3,13 @@ name: page-footer
|
|
|
3
3
|
status: stable
|
|
4
4
|
layouts: [documentation]
|
|
5
5
|
tokens:
|
|
6
|
+
- border.width.emphasis
|
|
6
7
|
- border.width.hairline
|
|
7
8
|
- color.border.subtle
|
|
9
|
+
- color.link.hover
|
|
10
|
+
- color.link.rest
|
|
8
11
|
- space.inline.lg
|
|
12
|
+
- space.inline.xs
|
|
9
13
|
- space.section.sm
|
|
10
14
|
- space.stack.lg
|
|
11
15
|
- space.stack.md
|
|
@@ -14,7 +18,7 @@ tokens:
|
|
|
14
18
|
|
|
15
19
|
# Page footer
|
|
16
20
|
|
|
17
|
-
After a documentation page's article: when the page last changed and a link to
|
|
21
|
+
After a documentation page's article: when the page last changed, what any generated tables come from, and a link to its source, then previous and next in the order of the navigation.
|
|
18
22
|
|
|
19
23
|
## When to use
|
|
20
24
|
|
|
@@ -30,8 +34,8 @@ After a documentation page's article: when the page last changed and a link to e
|
|
|
30
34
|
|
|
31
35
|
```html {preview=true}
|
|
32
36
|
<footer class="cx-page-footer">
|
|
33
|
-
<p class="cx-meta">Last updated <time datetime="2026-11-04">4 November 2026</time></p>
|
|
34
|
-
<a class="cx-link" href="https://github.com/owner/repo/
|
|
37
|
+
<p class="cx-meta">Last updated <time datetime="2026-11-04">4 November 2026</time> <span class="cx-sep" aria-hidden="true">|</span> <span>Generated from <a href="https://github.com/owner/repo/blob/main/tokens/color.json">tokens/color.json</a></span></p>
|
|
38
|
+
<a class="cx-link" href="https://github.com/owner/repo/blob/main/docs/foundations/colour.md">View source<svg class="cx-icon cx-icon--sm" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-outward"></use></svg></a>
|
|
35
39
|
</footer>
|
|
36
40
|
<nav class="cx-pagination" aria-label="Documentation pages">
|
|
37
41
|
<a class="cx-pagination__link" href="/guide/" rel="prev">
|
|
@@ -46,12 +50,26 @@ After a documentation page's article: when the page last changed and a link to e
|
|
|
46
50
|
</nav>
|
|
47
51
|
```
|
|
48
52
|
|
|
49
|
-
|
|
53
|
+
The link is **View source**, to the file on the repository's site, with `params.motifspec.sourceURL` (such as `https://github.com/owner/repo/blob/main/`). A site that would rather send readers straight to an editor sets `params.motifspec.editURL` instead, and the link is **Edit this page**, with the edit icon.
|
|
54
|
+
|
|
55
|
+
In Hugo, `partial "motifspec/page-footer.html" .` writes the footer and `partial "motifspec/pagination-docs.html" .` the previous and next links, in the order `docs-nav.html` lists the pages (`docs/hugo.md`).
|
|
56
|
+
|
|
57
|
+
### Pages made from other files
|
|
58
|
+
|
|
59
|
+
A page with no file of its own, such as one a content adapter makes from another file, sets these params:
|
|
60
|
+
|
|
61
|
+
<!-- caption: Page footer params -->
|
|
62
|
+
| Param | Is | Example |
|
|
63
|
+
|---|---|---|
|
|
64
|
+
| `source` | The repository path of the file the page is made from | `README.md` |
|
|
65
|
+
| `sourceAnchor` | The heading the page starts at, when it is one section of the file (View source only) | `getting-started` |
|
|
66
|
+
| `data` | The files its generated tables come from, shown as "Generated from" | `["tokens/color.json"]` |
|
|
50
67
|
|
|
51
68
|
## Do
|
|
52
69
|
|
|
53
70
|
- Show the date the content last changed, from version control where possible, written as a reader would say it ("4 November 2026").
|
|
54
|
-
- Link
|
|
71
|
+
- Link to the page's source file, not to a generated copy. A page made from one section of a file opens at that section (`sourceAnchor`, below); a file in an editor can't, so prefer View source for a site with such pages.
|
|
72
|
+
- Name the files a page's generated tables come from, after the date, so a reader knows where to change a value.
|
|
55
73
|
- Name the group in the pagination's middle cell, with the page's position in the whole set.
|
|
56
74
|
|
|
57
75
|
## Don't
|
|
@@ -62,6 +80,7 @@ In Hugo, `partial "motifspec/page-footer.html" .` writes the footer (a page made
|
|
|
62
80
|
## Accessibility
|
|
63
81
|
|
|
64
82
|
- The date is a `<time>` with a machine-readable `datetime`.
|
|
65
|
-
- The
|
|
83
|
+
- The link's text says what it does (View source, or Edit this page); its icons are `aria-hidden`, and the outward arrow repeats that it leaves the site.
|
|
66
84
|
- The pagination is a `<nav>` named "Documentation pages", separate from the navigation's "Documentation". Pairs and targets as `pagination.md`.
|
|
85
|
+
- The generated-from links are underlined, like links in prose, so they read as links in the mono line without relying on colour.
|
|
67
86
|
- Pairs: `color.text.muted` on `color.surface.base` (4.5:1) for the date; `color.link.rest` on `color.surface.base` (7:1).
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
weight: 3
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Colour
|
|
6
|
+
|
|
7
|
+
The primitive palette, and the semantic colours built on it that components and pages use, each with its light and dark value and its rule.
|
|
8
|
+
|
|
9
|
+
## Palette
|
|
10
|
+
|
|
11
|
+
Five hues generated in OKLCH so the steps are perceptually even, stored as sRGB. Primitives are never used directly in components or pages: they exist so semantic colours can point at them.
|
|
12
|
+
|
|
13
|
+
*Generated from `tokens/color.json`: the palette.*
|
|
14
|
+
|
|
15
|
+
## Semantic colours
|
|
16
|
+
|
|
17
|
+
Each semantic colour names a primitive for each theme, and the page switches with `light-dark()`, following the system unless the reader picks a theme. A text colour lists the surfaces it may sit on; [Contrast pairs](/reference/contrast/) measures every one.
|
|
18
|
+
|
|
19
|
+
*Generated from `tokens/color.json`: semantic colours.*
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
weight: 7
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Icons
|
|
6
|
+
|
|
7
|
+
The approved icons, each for its listed use: Material Symbols in the Sharp style at weight 300, self-hosted as a sprite.
|
|
8
|
+
|
|
9
|
+
## Approved icons
|
|
10
|
+
|
|
11
|
+
Use them as `icon.md` says: beside text that says the same thing, from the sprite.
|
|
12
|
+
|
|
13
|
+
*Generated from `icons/manifest.json`: the icons.*
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
weight: 6
|
|
3
|
+
toc: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Motion
|
|
7
|
+
|
|
8
|
+
The durations and curves for the few things that move. Under reduced motion every duration is zero.
|
|
9
|
+
|
|
10
|
+
## Durations and curves
|
|
11
|
+
|
|
12
|
+
Only state changes animate, and the contour survey ([Principles](/foundations/principles/)).
|
|
13
|
+
|
|
14
|
+
*Generated from `tokens/motion.json`: motion tokens.*
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
weight: 8
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Ornaments
|
|
6
|
+
|
|
7
|
+
The approved Yarndings 12 glyphs, by group, and the ones that are never used. Ornaments are decoration only, always hidden from assistive tech (`ornament.md`).
|
|
8
|
+
|
|
9
|
+
## Roles
|
|
10
|
+
|
|
11
|
+
The system's own ornaments always use these glyphs.
|
|
12
|
+
|
|
13
|
+
*Generated from `tokens/typography.json`: ornament roles.*
|
|
14
|
+
|
|
15
|
+
## Approved glyphs
|
|
16
|
+
|
|
17
|
+
*Generated from `tokens/typography.json`: approved glyphs.*
|
|
18
|
+
|
|
19
|
+
## Never used
|
|
20
|
+
|
|
21
|
+
*Generated from `tokens/typography.json`: forbidden glyphs.*
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
weight: 5
|
|
3
|
+
toc: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Space and size
|
|
7
|
+
|
|
8
|
+
A 4px spacing grid with roles for padding and gaps, and the sizes, radii and borders components are drawn with.
|
|
9
|
+
|
|
10
|
+
## Spacing
|
|
11
|
+
|
|
12
|
+
Components use the semantic roles: inset is padding, stack is a vertical gap, inline a horizontal gap, and section and gutter space out a page. The steps they point at, to scale:
|
|
13
|
+
|
|
14
|
+
*Generated from `tokens/space.json`: spacing steps.*
|
|
15
|
+
|
|
16
|
+
*Generated from `tokens/space.json`: space tokens.*
|
|
17
|
+
|
|
18
|
+
## Size
|
|
19
|
+
|
|
20
|
+
*Generated from `tokens/size.json`: size tokens.*
|
|
21
|
+
|
|
22
|
+
## Radius and border
|
|
23
|
+
|
|
24
|
+
*Generated from `tokens/radius.json`: radius tokens.*
|
|
25
|
+
|
|
26
|
+
*Generated from `tokens/border.json`: border tokens.*
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
weight: 4
|
|
3
|
+
toc: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Type
|
|
7
|
+
|
|
8
|
+
The typefaces, the type scale and the weights, leading and tracking that set every piece of text.
|
|
9
|
+
|
|
10
|
+
## Typefaces
|
|
11
|
+
|
|
12
|
+
*Generated from `tokens/typography.json`: typefaces.*
|
|
13
|
+
|
|
14
|
+
## Type scale
|
|
15
|
+
|
|
16
|
+
Sizes are fluid between the smallest and widest screens, and the smallest stay fixed so labels never shrink. Each sample is set at its size.
|
|
17
|
+
|
|
18
|
+
*Generated from `tokens/typography.json`: the type scale.*
|
|
19
|
+
|
|
20
|
+
## Weight, leading and tracking
|
|
21
|
+
|
|
22
|
+
*Generated from `tokens/typography.json`: weight, leading and tracking.*
|
package/docs/hugo.md
CHANGED
|
@@ -86,7 +86,7 @@ enableGitInfo = true # Lastmod from Git, for "Last updated"
|
|
|
86
86
|
|
|
87
87
|
[params.motifspec]
|
|
88
88
|
layout = "documentation"
|
|
89
|
-
|
|
89
|
+
sourceURL = "https://github.com/owner/repo/blob/main/"
|
|
90
90
|
```
|
|
91
91
|
|
|
92
92
|
The templates are `layouts/page.markdown.md`, `section.markdown.md` and `home.markdown.md`; a site's own file at the same path wins.
|
|
@@ -132,7 +132,7 @@ Every partial below is called as `partial "motifspec/<name>.html" <context>`.
|
|
|
132
132
|
| `pagination-pages.html` | `pagination.md` | `dict "pager" $pager "label" "Writing pages"`. Pages of a paginated list; nothing when it fits on one page. |
|
|
133
133
|
| `docs-nav.html` | `docs-shell.md` | A page. The documentation layout's navigation: top-level pages, then a group per top-level section in weight order. `docs_nav: false` in front matter leaves a page or section out. |
|
|
134
134
|
| `page-actions.html` | `page-actions.md` | A page. Copy page and View as Markdown, when the page has the markdown output format; nothing otherwise. |
|
|
135
|
-
| `page-footer.html` | `page-footer.md` | A page. Last updated (its `Lastmod`) and Edit this page, from `
|
|
135
|
+
| `page-footer.html` | `page-footer.md` | A page. Last updated (its `Lastmod`), Generated from (its `data` param) and View source, from `params.motifspec.sourceURL` (or Edit this page, from `editURL`) and, for a site in a folder of its repository, `params.motifspec.siteDir`. A page with no file of its own sets `source` and, for one section of a file, `sourceAnchor`. |
|
|
136
136
|
| `pagination-docs.html` | `pagination.md`, `page-footer.md` | A page. Previous and next in the order `docs-nav.html` lists the pages. |
|
|
137
137
|
| `search.html` | `search.md` | A page. The search trigger and dialog; `site-header.html` calls it when `params.motifspec.search` is true. |
|
|
138
138
|
| `back-link.html` | `button-and-link.md` | `dict "href" "…" "label" "All work"`. |
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
weight: 3
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Checker rules
|
|
6
|
+
|
|
7
|
+
What the checker reports, and what to do instead. Rules that warn will fail the run in a later release.
|
|
8
|
+
|
|
9
|
+
## Rules
|
|
10
|
+
|
|
11
|
+
*Generated from `scripts/check.mjs`: checker rules.*
|
|
12
|
+
|
|
13
|
+
[Checking a project](/guide/checking/) says how to run it.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
weight: 2
|
|
3
|
+
toc: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Contrast pairs
|
|
7
|
+
|
|
8
|
+
Every foreground and the surfaces it may sit on (`codex.pairsWith`), measured in both themes on every build.
|
|
9
|
+
|
|
10
|
+
## Targets
|
|
11
|
+
|
|
12
|
+
Reading text targets 7:1, metadata and status labels 4.5:1, and controls, focus and graphics 3:1. Each sample is drawn in the pair's own colours for that theme.
|
|
13
|
+
|
|
14
|
+
*Generated from `tokens/color.json`: the contrast summary.*
|
|
15
|
+
|
|
16
|
+
## Pairs
|
|
17
|
+
|
|
18
|
+
*Generated from `tokens/color.json`: contrast pairs.*
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
weight: 1
|
|
3
|
+
toc: false
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Tokens
|
|
7
|
+
|
|
8
|
+
Every semantic token, with its value and rule. Pages and components use these; the primitives behind them are not for use outside MotifSpec.
|
|
9
|
+
|
|
10
|
+
*Generated from `tokens/`: deprecated tokens.*
|
|
11
|
+
|
|
12
|
+
A token's CSS name is `--cx-` and its name with dashes: `color.text.primary` is `--cx-color-text-primary`. A colour shows its light value, then its dark one.
|
|
13
|
+
|
|
14
|
+
*Generated from `tokens/`: every semantic token.*
|
|
@@ -1,24 +1,39 @@
|
|
|
1
|
-
{{- /* page-footer.md: when the page last changed (its Lastmod; with enableGitInfo, from Git)
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
{{- /* page-footer.md: when the page last changed (its Lastmod; with enableGitInfo, from Git), what its generated parts
|
|
2
|
+
come from, and a link to its source. Context: a page.
|
|
3
|
+
- The link needs the repository's address for viewing files, params.motifspec.sourceURL, such as
|
|
4
|
+
"https://github.com/owner/repo/blob/main/" ("View source"), or for editing them, params.motifspec.editURL,
|
|
5
|
+
such as "https://github.com/owner/repo/edit/main/" ("Edit this page"). With both, View source is shown.
|
|
6
|
+
- The path is the page's file. When the site lives in a folder of the repository, set params.motifspec.siteDir to
|
|
7
|
+
that folder. A page with no file of its own, such as one a content adapter makes from another file, names that
|
|
8
|
+
file's repository path as its `source` param, and `sourceAnchor` for the heading it starts at, if it is one
|
|
9
|
+
section of the file (View source only; an editor can't open at a heading).
|
|
10
|
+
- A page whose tables or lists are generated names the files they come from as its `data` param (a list of
|
|
11
|
+
repository paths), shown after the date and linked with sourceURL. */ -}}
|
|
7
12
|
{{- $p := . -}}
|
|
13
|
+
{{- $path := "" -}}
|
|
14
|
+
{{- with $p.Params.source -}}
|
|
15
|
+
{{- $path = strings.TrimPrefix "/" . -}}
|
|
16
|
+
{{- else with $p.File -}}
|
|
17
|
+
{{- $root := strings.TrimSuffix (printf "/%s" (site.Params.motifspec.siteDir | default "" | strings.Trim "/")) hugo.WorkingDir -}}
|
|
18
|
+
{{- $path = strings.TrimPrefix (printf "%s/" $root) .Filename -}}
|
|
19
|
+
{{- end -}}
|
|
20
|
+
{{- $view := "" -}}
|
|
8
21
|
{{- $edit := "" -}}
|
|
9
|
-
{{- with site.Params.motifspec.
|
|
10
|
-
{{- $
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
{{- else with $p.File -}}
|
|
14
|
-
{{- $root := strings.TrimSuffix (printf "/%s" (site.Params.motifspec.siteDir | default "" | strings.Trim "/")) hugo.WorkingDir -}}
|
|
15
|
-
{{- $edit = printf "%s%s" $base (strings.TrimPrefix (printf "%s/" $root) .Filename) -}}
|
|
16
|
-
{{- end -}}
|
|
22
|
+
{{- with and $path site.Params.motifspec.sourceURL -}}
|
|
23
|
+
{{- $view = printf "%s%s%s" . $path (cond (ne ($p.Params.sourceAnchor | default "") "") (printf "#%s" $p.Params.sourceAnchor) "") -}}
|
|
24
|
+
{{- else with and $path site.Params.motifspec.editURL -}}
|
|
25
|
+
{{- $edit = printf "%s%s" . $path -}}
|
|
17
26
|
{{- end -}}
|
|
18
|
-
{{- if or (not $p.Lastmod.IsZero) $edit }}
|
|
27
|
+
{{- if or (not $p.Lastmod.IsZero) $view $edit }}
|
|
19
28
|
<footer class="cx-page-footer" data-pagefind-ignore>
|
|
20
|
-
{{- if not $p.Lastmod.IsZero }}
|
|
21
|
-
<p class="cx-meta">
|
|
29
|
+
{{- if or (not $p.Lastmod.IsZero) $p.Params.data }}
|
|
30
|
+
<p class="cx-meta">
|
|
31
|
+
{{- if not $p.Lastmod.IsZero }}Last updated <time datetime="{{ $p.Lastmod.Format "2006-01-02" }}">{{ $p.Lastmod.Format "2 January 2006" }}</time>{{ end }}
|
|
32
|
+
{{- with $p.Params.data }}{{ if not $p.Lastmod.IsZero }} <span class="cx-sep" aria-hidden="true">|</span> {{ end }}<span>Generated from {{ range $i, $d := . }}{{ if $i }}{{ if eq $i (sub (len $p.Params.data) 1) }} and {{ else }}, {{ end }}{{ end }}{{ with site.Params.motifspec.sourceURL }}<a href="{{ . }}{{ $d }}">{{ $d }}</a>{{ else }}{{ $d }}{{ end }}{{ end }}</span>{{ end -}}
|
|
33
|
+
</p>
|
|
34
|
+
{{- end }}
|
|
35
|
+
{{- with $view }}
|
|
36
|
+
<a class="cx-link" href="{{ . }}">View source<svg class="cx-icon cx-icon--sm" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-outward"></use></svg></a>
|
|
22
37
|
{{- end }}
|
|
23
38
|
{{- with $edit }}
|
|
24
39
|
<a class="cx-link" href="{{ . }}"><svg class="cx-icon cx-icon--sm" aria-hidden="true" focusable="false"><use href="#cx-icon-edit"></use></svg>Edit this page<svg class="cx-icon cx-icon--sm" aria-hidden="true" focusable="false"><use href="#cx-icon-arrow-outward"></use></svg></a>
|
package/package.json
CHANGED