@taprootio/site-authoring 0.61.0 → 0.62.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -0
- package/package.json +1 -1
- package/src/appearance-contract.js +18 -0
- package/src/article-appearance.js +19 -0
- package/src/article-appearance.json +9 -0
- package/src/changelog.json +10 -0
- package/src/presentation-reference.js +1 -1
- package/src/reference-help.js +1 -1
- package/src/setting-reference.js +32 -0
- package/src/settings-catalog.js +2 -0
- package/src/template-token-reach.json +6 -0
- package/src/verbs/theme-push.js +6 -6
package/README.md
CHANGED
|
@@ -1503,6 +1503,40 @@ fields beside the message, so the command to run after upgrading is in the
|
|
|
1503
1503
|
refusal itself. Every release's notes live in one file, `src/changelog.json`,
|
|
1504
1504
|
and a package test fails when the installed version has no entry there.
|
|
1505
1505
|
|
|
1506
|
+
### Article appearance
|
|
1507
|
+
|
|
1508
|
+
Edit the `settings` object in the pulled `settings/taproot-styles.json` file.
|
|
1509
|
+
For jereme.net, this example gives inline code a light tint and padding.
|
|
1510
|
+
|
|
1511
|
+
```json
|
|
1512
|
+
{
|
|
1513
|
+
"articleInlineCodeBackground": "subtle",
|
|
1514
|
+
"articleInlineCodePadding": "light",
|
|
1515
|
+
"articleInlineCodeBorder": "none",
|
|
1516
|
+
"articleInlineCodeShadow": "none"
|
|
1517
|
+
}
|
|
1518
|
+
```
|
|
1519
|
+
|
|
1520
|
+
The tint uses each scheme's link color. The four fields affect only inline code
|
|
1521
|
+
in the article body. Fenced blocks, numbered-list markers, and code elsewhere
|
|
1522
|
+
have their own styles.
|
|
1523
|
+
|
|
1524
|
+
Use separate fields to size article titles. For example, `"articleTitleMobileSize":
|
|
1525
|
+
"1.25"` sets 1.25rem at 390px and below, `"articleTitleDesktopSize": "3"`
|
|
1526
|
+
caps the title at 3rem, and `"articleTitleDesktopAt": "960"` reaches that
|
|
1527
|
+
cap at a 960px viewport with a 16px root font. The title scales between those
|
|
1528
|
+
points. The mobile default is 1.625rem. Taproot tests it at 390px with a
|
|
1529
|
+
70-character title, the point above which Site Health warns about title length.
|
|
1530
|
+
Leave the desktop size empty to keep the theme's existing large title size.
|
|
1531
|
+
These fields apply only to the article's title. The shared type scale
|
|
1532
|
+
continues to style the rest of the site.
|
|
1533
|
+
|
|
1534
|
+
Omit an article field to preserve the saved value, or use `""` to reset it.
|
|
1535
|
+
Run `taproot-site validate` and `taproot-site theme push --dry-run`, then
|
|
1536
|
+
`taproot-site theme push`. Stage a release that includes Taproot styles,
|
|
1537
|
+
check the article in both schemes, then promote it. See `taproot-site help
|
|
1538
|
+
appearance` for all values and defaults.
|
|
1539
|
+
|
|
1506
1540
|
### Staging verification and deployment evidence
|
|
1507
1541
|
|
|
1508
1542
|
`deploy --staging` selects the same changed pages, settings groups and navigation
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taprootio/site-authoring",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.62.0",
|
|
4
4
|
"description": "Taproot site authoring CLI: sign in once in the browser, then pull, validate, push, preview, approve, and deploy a site from the terminal",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "ISC",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ARTICLE_APPEARANCE_CONTRACT, ARTICLE_APPEARANCE_FIELDS, isArticleAppearanceValue } from "./article-appearance.js";
|
|
1
2
|
import {
|
|
2
3
|
BLOCK_SPACINGS,
|
|
3
4
|
DEFAULT_BLOCK_SPACING,
|
|
@@ -70,6 +71,16 @@ export const APPEARANCE_SCALAR_FIELDS = Object.freeze([
|
|
|
70
71
|
values: Object.freeze(Object.keys(BLOCK_SPACINGS)),
|
|
71
72
|
default: DEFAULT_BLOCK_SPACING,
|
|
72
73
|
}),
|
|
74
|
+
...ARTICLE_APPEARANCE_FIELDS.map(name => Object.freeze({
|
|
75
|
+
settingsType: SETTINGS_TYPE_TAPROOT_STYLES,
|
|
76
|
+
name,
|
|
77
|
+
path: `taproot-styles.${name}`,
|
|
78
|
+
type: "article-appearance",
|
|
79
|
+
...ARTICLE_APPEARANCE_CONTRACT[name],
|
|
80
|
+
optional: true,
|
|
81
|
+
onlyIfPresent: true,
|
|
82
|
+
default: "",
|
|
83
|
+
})),
|
|
73
84
|
...HEADING_SPACING_FIELDS.map((name) => Object.freeze({
|
|
74
85
|
settingsType: SETTINGS_TYPE_TAPROOT_STYLES,
|
|
75
86
|
name,
|
|
@@ -521,6 +532,13 @@ function validateScalar(definition, value, knownImageIds) {
|
|
|
521
532
|
}
|
|
522
533
|
return JSON.stringify(artwork);
|
|
523
534
|
}
|
|
535
|
+
case "article-appearance":
|
|
536
|
+
if (!isArticleAppearanceValue(definition.name, value)) {
|
|
537
|
+
const choices = definition.values?.join(", ")
|
|
538
|
+
?? `a numeric string from ${definition.min} through ${definition.max}${definition.decimalPlaces ? "" : " (whole numbers)"}`;
|
|
539
|
+
fail("theme.setting_invalid", `${definition.path} must be empty or one of these values: ${choices}.`, definition.path);
|
|
540
|
+
}
|
|
541
|
+
return value;
|
|
524
542
|
case "heading-spacing":
|
|
525
543
|
if (value !== "" && !isHeadingSpacing(value)) {
|
|
526
544
|
fail(
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Generated from shared/article-appearance.ts by scripts/sync-field-validation.mjs. Do not edit.
|
|
2
|
+
import contract from "./article-appearance.json" with { type: "json" };
|
|
3
|
+
export const ARTICLE_APPEARANCE_FIELDS = Object.keys(contract);
|
|
4
|
+
export { contract as ARTICLE_APPEARANCE_CONTRACT };
|
|
5
|
+
export function isArticleAppearanceValue(field, value) {
|
|
6
|
+
if (typeof value !== "string")
|
|
7
|
+
return false;
|
|
8
|
+
if (value === "")
|
|
9
|
+
return true;
|
|
10
|
+
const rule = contract[field];
|
|
11
|
+
if ("values" in rule)
|
|
12
|
+
return rule.values.includes(value);
|
|
13
|
+
const fraction = rule.decimalPlaces ? `(?:\\.[0-9]{1,${rule.decimalPlaces}})?` : "";
|
|
14
|
+
// Match the whole string, including when a newline is present at the end.
|
|
15
|
+
if (!new RegExp(`^(?:0|[1-9][0-9]*)${fraction}(?![\\s\\S])`, "u").test(value))
|
|
16
|
+
return false;
|
|
17
|
+
const number = Number(value);
|
|
18
|
+
return number >= rule.min && number <= rule.max;
|
|
19
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"articleInlineCodeBackground": { "values": ["subtle", "transparent", "layer1", "layer2"] },
|
|
3
|
+
"articleInlineCodePadding": { "values": ["none", "light", "regular"] },
|
|
4
|
+
"articleInlineCodeBorder": { "values": ["none", "dotted", "dashed", "solid"] },
|
|
5
|
+
"articleInlineCodeShadow": { "values": ["none", "1", "2", "3"] },
|
|
6
|
+
"articleTitleMobileSize": { "min": 1, "max": 6, "decimalPlaces": 3, "fallback": 1.625 },
|
|
7
|
+
"articleTitleDesktopSize": { "min": 1, "max": 6, "decimalPlaces": 3 },
|
|
8
|
+
"articleTitleDesktopAt": { "min": 640, "max": 1920, "decimalPlaces": 0, "fallback": 1200 }
|
|
9
|
+
}
|
package/src/changelog.json
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"entries": [
|
|
3
|
+
{
|
|
4
|
+
"version": "0.62.0",
|
|
5
|
+
"note": "Article publication dates follow the byline, and article title sizing and inline code have their own appearance settings.",
|
|
6
|
+
"behavior": [
|
|
7
|
+
"An article with a displayDate emits that day in the site's time zone as BlogPosting.datePublished. Without displayDate it emits the recorded first publication. dateModified still tracks published content edits. Regenerate and publish the site to update its served article HTML.",
|
|
8
|
+
"Edit settings/taproot-styles.json to adjust article inline code fill, padding, border and shadow, or change the article title's mobile size, desktop size and scaling viewport. The fields are independent. Validate and save with theme push, then stage the Taproot styles and promote the release.",
|
|
9
|
+
"The help reference version is 86."
|
|
10
|
+
],
|
|
11
|
+
"help": ["appearance", "settings"]
|
|
12
|
+
},
|
|
3
13
|
{
|
|
4
14
|
"version": "0.61.0",
|
|
5
15
|
"note": "Feedback from building jereme.net on 0.59.0: a deleted page's path can take a redirect, legal roles and keys are checked before a push, refused fields carry Taproot's reason, Espalier 7.9.0 and 7.10.0 add button, header and heading controls, and listing cards take a site default.",
|
|
@@ -660,7 +660,7 @@ export function getAppearanceReference() {
|
|
|
660
660
|
+ "fontMenu falls back to the body font, never to headings.",
|
|
661
661
|
changeSet: [
|
|
662
662
|
"the footer context and logo variant, saved alongside the theme and header presentation",
|
|
663
|
-
"default scheme, assets, favicon,
|
|
663
|
+
"default scheme, assets, favicon, breadcrumbs, heading spacing, article and header settings. Omit article fields to preserve them. Use an empty string to reset.",
|
|
664
664
|
"recipeJumpControl, recipeTagsIcon, recipeTagsContent, tag bar colors, pageTagBadges, the listing card default and optional destination maps in settings/site-publishing-preferences.json",
|
|
665
665
|
"the complete light theme and the complete dark theme",
|
|
666
666
|
],
|
package/src/reference-help.js
CHANGED
|
@@ -99,7 +99,7 @@ import {
|
|
|
99
99
|
|
|
100
100
|
export { getAppearanceReference, getFooterReference, getSettingsReference, getThemeReference };
|
|
101
101
|
|
|
102
|
-
export const REFERENCE_VERSION =
|
|
102
|
+
export const REFERENCE_VERSION = 86;
|
|
103
103
|
|
|
104
104
|
// The date-limit examples `help forms` prints; tests run them through the form validator.
|
|
105
105
|
export const FORM_DATE_WINDOW_FIELD = Object.freeze({
|
package/src/setting-reference.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { readFileSync } from "node:fs";
|
|
2
2
|
|
|
3
|
+
import { ARTICLE_APPEARANCE_CONTRACT } from "./article-appearance.js";
|
|
3
4
|
import { APPEARANCE_SCALAR_FIELDS } from "./appearance-contract.js";
|
|
4
5
|
import { BLOCK_SPACINGS, HEADING_SPACING_FIELDS } from "./block-flow.js";
|
|
5
6
|
import { RECIPE_TAGS_BAR_COLOR_TOKENS } from "./brand-color.js";
|
|
@@ -141,7 +142,38 @@ export const PAGE_BACKGROUND_VERSUS_CANVAS = Object.freeze({
|
|
|
141
142
|
+ "published site copies the file the URL names into its own assets; it does not resize it.",
|
|
142
143
|
});
|
|
143
144
|
|
|
145
|
+
const ARTICLE_CODE_RENDERS = "Inline code in published article prose in both color schemes.";
|
|
146
|
+
const ARTICLE_TITLE_RENDERS = "The published article title in both color schemes.";
|
|
147
|
+
const ARTICLE_STYLE_LABEL = "Article appearance (CLI)";
|
|
148
|
+
|
|
149
|
+
function articleTitleSize(name, description, unit) {
|
|
150
|
+
const { min, max, fallback, decimalPlaces } = ARTICLE_APPEARANCE_CONTRACT[name];
|
|
151
|
+
return entry(ARTICLE_STYLE_LABEL,
|
|
152
|
+
description + ` ${decimalPlaces ? "Decimal" : "Whole-number"} string, ${min}–${max} ${unit}.`
|
|
153
|
+
+ (fallback === undefined ? "" : ` Default ${fallback}.`),
|
|
154
|
+
ARTICLE_TITLE_RENDERS);
|
|
155
|
+
}
|
|
156
|
+
|
|
144
157
|
const TAPROOT_STYLES_ENTRIES = {
|
|
158
|
+
articleInlineCodeBackground: entry(ARTICLE_STYLE_LABEL,
|
|
159
|
+
"Choose subtle (a tint from the current scheme's link color), transparent, layer1 or layer2. Empty uses the theme's regular inline code fill.",
|
|
160
|
+
ARTICLE_CODE_RENDERS),
|
|
161
|
+
articleInlineCodePadding: entry(ARTICLE_STYLE_LABEL,
|
|
162
|
+
"Choose none, light (0.05em block and 0.2em inline) or regular (0 block and 0.35em inline). Empty uses regular padding.",
|
|
163
|
+
ARTICLE_CODE_RENDERS),
|
|
164
|
+
articleInlineCodeBorder: entry(ARTICLE_STYLE_LABEL,
|
|
165
|
+
"Choose none, dotted, dashed or solid. Uses the theme border color. Empty follows the shared code border.",
|
|
166
|
+
ARTICLE_CODE_RENDERS),
|
|
167
|
+
articleInlineCodeShadow: entry(ARTICLE_STYLE_LABEL,
|
|
168
|
+
"Choose none or an elevation of 1, 2 or 3. Empty uses the theme's regular inline code shadow.",
|
|
169
|
+
ARTICLE_CODE_RENDERS),
|
|
170
|
+
articleTitleMobileSize: articleTitleSize("articleTitleMobileSize",
|
|
171
|
+
"Title size at 390 CSS pixels and below, capped at the desktop size.", "rem"),
|
|
172
|
+
articleTitleDesktopSize: articleTitleSize("articleTitleDesktopSize",
|
|
173
|
+
"Maximum size. Empty follows the theme’s large type.", "rem"),
|
|
174
|
+
articleTitleDesktopAt: articleTitleSize("articleTitleDesktopAt",
|
|
175
|
+
"Viewport width at which the title reaches its desktop size with a 16px root font. Between 390px and this width the title grows linearly.", "CSS pixels"),
|
|
176
|
+
|
|
145
177
|
lightTheme: entry(
|
|
146
178
|
"Brand & style (light scheme)",
|
|
147
179
|
"The complete Espalier theme for the light scheme: colors, fonts, scales and the page background image.",
|
package/src/settings-catalog.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { parseTheme } from "@taprootio/espalier/shared/theme";
|
|
2
2
|
|
|
3
|
+
import { ARTICLE_APPEARANCE_FIELDS } from "./article-appearance.js";
|
|
3
4
|
import { HEADING_SPACING_FIELDS, normalizeHeadingSpacing } from "./block-flow.js";
|
|
4
5
|
import { BREADCRUMB_ARTWORK_FIELDS, decodeBreadcrumbArtwork } from "./breadcrumb-artwork.js";
|
|
5
6
|
import { normalizeBreadcrumbSeparator, normalizeBreadcrumbTrailEnd } from "./breadcrumb-separators.js";
|
|
@@ -81,6 +82,7 @@ export const SETTINGS_GROUPS = Object.freeze([
|
|
|
81
82
|
"darkCanvasImageId",
|
|
82
83
|
"darkCanvasImageUrl",
|
|
83
84
|
),
|
|
85
|
+
...ARTICLE_APPEARANCE_FIELDS.map(name => ({ name, wireType: "string", optional: true })),
|
|
84
86
|
...HEADING_SPACING_FIELDS.map(name => ({ name, wireType: "string", normalize: normalizeHeadingSpacing })),
|
|
85
87
|
{ name: "contentInset", wireType: "string", normalize: normalizeContentInset },
|
|
86
88
|
{ name: "breadcrumbSeparator", wireType: "string", normalize: normalizeBreadcrumbSeparator },
|
|
@@ -22,6 +22,12 @@
|
|
|
22
22
|
{"token": "intent:danger", "file": "generator/client/pages/cta/taproot-cta.ts", "markup": "esp-button[class=\"cta__button\"]", "part": "intent", "label": "destructive call-to-action button", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
23
23
|
{"token": "--esp-color-background", "file": "generator/client/pages/cta/taproot-cta.ts", "markup": ":host([context]:not([context=\"\"])) .cta", "part": "background", "label": "cta panel fill from its context", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
24
24
|
{"token": "--esp-color-border", "file": "generator/client/pages/cta/taproot-cta.ts", "markup": ".cta--bordered", "part": "border", "label": "cta bordered border", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
25
|
+
{"token": "--esp-color-link","file": "generator/src/article-appearance-css.ts","markup": "subtle","part": "CSS value","label": "article inline code tint","topics": ["article"]},
|
|
26
|
+
{"token": "--esp-color-layer-1","file": "generator/src/article-appearance-css.ts","markup": "layer1","part": "CSS value","label": "article inline code layer 1 background","topics": ["article"]},
|
|
27
|
+
{"token": "--esp-color-layer-2","file": "generator/src/article-appearance-css.ts","markup": "layer2","part": "CSS value","label": "article inline code layer 2 background","topics": ["article"]},
|
|
28
|
+
{"token": "--esp-color-shadow","file": "generator/src/article-appearance-css.ts","markup": "1","part": "CSS value via --esp-shadow-1","label": "article inline code elevation 1","topics": ["article"]},
|
|
29
|
+
{"token": "--esp-color-shadow","file": "generator/src/article-appearance-css.ts","markup": "2","part": "CSS value via --esp-shadow-2","label": "article inline code elevation 2","topics": ["article"]},
|
|
30
|
+
{"token": "--esp-color-shadow","file": "generator/src/article-appearance-css.ts","markup": "3","part": "CSS value via --esp-shadow-3","label": "article inline code elevation 3","topics": ["article"]},
|
|
25
31
|
{"token": "--esp-color-headings", "file": "generator/src/hero-cta-markup.ts", "markup": "taproot-cta > [slot=\"heading\"]", "part": "color", "label": "cta heading ink", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
26
32
|
{"token": "--esp-color-text", "file": "generator/src/hero-cta-markup.ts", "markup": "taproot-cta > [slot=\"description\"]", "part": "color", "label": "cta description ink", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
|
27
33
|
{"token": "--esp-color-headings", "file": "generator/client/pages/feature-grid/taproot-feature-grid.ts", "markup": ":host", "part": "--taproot-fg-icon-color", "label": "feature icon ink", "topics": ["free-form", "article", "album", "recipe", "place-review", "legal", "generated"]},
|
package/src/verbs/theme-push.js
CHANGED
|
@@ -303,9 +303,9 @@ function ownedDocuments(validated, projected) {
|
|
|
303
303
|
local: Object.fromEntries(names.map((name) => [name, valueOf(settingsType, local, name)])),
|
|
304
304
|
remote: Object.fromEntries(names.map((name) => [name, valueOf(settingsType, remote, name)])),
|
|
305
305
|
});
|
|
306
|
-
const scalarNames = (settingsType) =>
|
|
306
|
+
const scalarNames = (settingsType, document) =>
|
|
307
307
|
APPEARANCE_SCALAR_FIELDS.filter((field) => field.settingsType === settingsType
|
|
308
|
-
&& (!field.onlyIfPresent || Object.hasOwn(
|
|
308
|
+
&& (!field.onlyIfPresent || Object.hasOwn(document, field.name))).map((field) => field.name);
|
|
309
309
|
const publishingDocument = document => ({
|
|
310
310
|
...document,
|
|
311
311
|
footerSettings: Object.fromEntries(
|
|
@@ -317,20 +317,20 @@ function ownedDocuments(validated, projected) {
|
|
|
317
317
|
SETTINGS_TYPE_TAPROOT_STYLES,
|
|
318
318
|
validated.style,
|
|
319
319
|
projected[SETTINGS_TYPE_TAPROOT_STYLES],
|
|
320
|
-
[...THEME_SETTINGS, ...scalarNames(SETTINGS_TYPE_TAPROOT_STYLES)],
|
|
320
|
+
[...THEME_SETTINGS, ...scalarNames(SETTINGS_TYPE_TAPROOT_STYLES, validated.style)],
|
|
321
321
|
),
|
|
322
|
-
owned(SETTINGS_TYPE_BRAND, validated.brand, projected[SETTINGS_TYPE_BRAND], scalarNames(SETTINGS_TYPE_BRAND)),
|
|
322
|
+
owned(SETTINGS_TYPE_BRAND, validated.brand, projected[SETTINGS_TYPE_BRAND], scalarNames(SETTINGS_TYPE_BRAND, validated.brand)),
|
|
323
323
|
owned(
|
|
324
324
|
SETTINGS_TYPE_SITE_HEADER,
|
|
325
325
|
validated.header,
|
|
326
326
|
projected[SETTINGS_TYPE_SITE_HEADER],
|
|
327
|
-
scalarNames(SETTINGS_TYPE_SITE_HEADER),
|
|
327
|
+
scalarNames(SETTINGS_TYPE_SITE_HEADER, validated.header),
|
|
328
328
|
),
|
|
329
329
|
owned(
|
|
330
330
|
SETTINGS_TYPE_SITE_PUBLISHING_PREFERENCES,
|
|
331
331
|
publishingDocument(validated.publishing),
|
|
332
332
|
publishingDocument(projected[SETTINGS_TYPE_SITE_PUBLISHING_PREFERENCES]),
|
|
333
|
-
[...scalarNames(SETTINGS_TYPE_SITE_PUBLISHING_PREFERENCES), "footerSettings"],
|
|
333
|
+
[...scalarNames(SETTINGS_TYPE_SITE_PUBLISHING_PREFERENCES, validated.publishing), "footerSettings"],
|
|
334
334
|
),
|
|
335
335
|
];
|
|
336
336
|
}
|