Skip to content

Commit 2f6d7df

Browse files
committed
feat(layouts): de-duplicated layout source in gitpagelayouts/v2
- v2/base.json holds what every layout shares (typography, component sizes, dark/light defaults) and the palette rules for control colours; each v2/layouts/<id>.json keeps only identity, colours and overrides (132 KB of templates -> 30 KB of source; only the two duet layouts need overrides). - layouts:sync expands v2 into the unchanged templates/<id>.json format (canonical key order), so viewers and remote consumers are unaffected; a test fails when the committed templates drift from v2. - The expansion fixes the 29 light layouts whose button hover glow was still the generic violet: it now follows each palette's primary colour. - CHANGELOG "Unreleased" entries for the chat guide, markdown actions and v2.
1 parent a9a4c41 commit 2f6d7df

99 files changed

Lines changed: 1587 additions & 38 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎CHANGELOG.md‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,35 @@ All notable changes to Git Page Docs are documented here. Versions follow semver
55

66
## Unreleased
77

8+
### Frontend viewer
9+
10+
- **"How to use and risks" guide in the AI chat.** A new exclamation-mark button in the drawer header
11+
opens a tab (available even before a password exists) that explains in pt, en and es how the
12+
assistant works (local password, encrypted vault, per-request decryption, locking), how to use it,
13+
everything that can happen in the flow (wrong or forgotten password, inactivity lock with the
14+
configured seconds, retries, invalid key, retired model, Ollama/CORS, offline, cleared browser data)
15+
and the risks the user takes (key visible in DevTools during use, Gemini key in the URL, weak
16+
passwords, shared computers, extensions, data sent to the provider, billing, wrong answers). Copy lives
17+
in the new `langmenu` keys `aiChatInfo*` (items one per line).
18+
- **Copy and download on markdown pages.** Two buttons beside the fullscreen button copy the page's
19+
original `.md` text to the clipboard (with a "Copied!" confirmation) or download it as a `.md` file,
20+
in the language being read. The loader now keeps the original file text next to the rendered HTML
21+
(`sourceByLanguage`), reading each file once. New icons `FiCopy`, `FiDownload`, `FiCheck` and
22+
`langmenu` keys `mdCopyLabel`, `mdCopiedLabel`, `mdCopyErrorLabel`, `mdDownloadLabel` in
23+
`gitpagedocs/langs/{pt,en,es}.json`.
24+
825
### Layouts
926

27+
- **De-duplicated layout source (`gitpagelayouts/v2/`).** Each of the 64 layouts used to repeat the
28+
same typography, component sizes, dark/light defaults and palette-derived control colours in its
29+
template (3,392 values, 132 KB). The source of truth is now `v2/base.json` (shared values, per-mode
30+
defaults and palette rules such as `"1px solid {cardBorder}"` / `"{primary|0.7}"`) plus one small
31+
`v2/layouts/<id>.json` per layout with only identity, colours and overrides (30 KB; only the two
32+
`duet` layouts need overrides). `pnpm run layouts:sync` expands them into the unchanged
33+
`templates/<id>.json` format, so viewers and remote consumers are not affected; a test fails if the
34+
committed templates drift from `v2/`. The expansion also fixes the 29 light layouts whose button
35+
hover glow was still the generic violet: it now follows each palette's primary colour.
36+
1037
- **Select and button controls follow each layout's palette.** The 62 layout templates that carried
1138
the generic slate values (`#0F172A` / `#FFFFFF` background, `#334155` / `#E2E8F0` border, cyan and
1239
violet hover/focus colours) now derive `components.select` and `components.button` from their own

‎gitpagelayouts/README.md‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,20 @@ consume these layouts:
99
`gitpagelayouts/` (or generate a local `gitpagedocs/layouts/` with
1010
`npx @gitpagedocs/cli --layoutconfig`) and the viewer resolves it automatically.
1111

12-
The JSON files here are the source of truth. After changing any of them,
13-
regenerate this catalog with `npm run layouts:sync`.
12+
The source of truth is `v2/`. `v2/base.json` holds every value the layouts share
13+
(typography, component sizes, dark/light defaults and the rules that derive control
14+
colors from each palette), and `v2/layouts/<id>.json` holds only the layout's
15+
identity, colors and the few values that differ. `npm run layouts:sync` expands
16+
them into the full `templates/<id>.json` files (the format viewers read, unchanged)
17+
and regenerates this catalog. Edit `v2/`, never `templates/`.
1418

1519
## Files
1620

1721
- [`layoutsConfig.json`](layoutsConfig.json) — index of every layout.
1822
- [`layoutsFallbackConfig.json`](layoutsFallbackConfig.json) — minimal fallback set.
19-
- [`templates/`](templates) — one JSON theme template per layout.
23+
- [`v2/base.json`](v2/base.json) — shared values and palette rules (source).
24+
- [`v2/layouts/`](v2/layouts) — one small file per layout (source).
25+
- [`templates/`](templates) — one full JSON theme template per layout (generated from `v2/`).
2026
- [`docs/`](docs) — one markdown page per layout (generated).
2127

2228
## Layouts (64)

‎gitpagelayouts/templates/amber-light.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"borderRadius": "12px",
4747
"padding": "10px 18px",
4848
"border": "1px solid #FDE68A",
49-
"hoverGlow": "0 0 0 4px rgba(109, 40, 217, 0.15)"
49+
"hoverGlow": "0 0 0 3px rgba(217, 119, 6, 0.18)"
5050
},
5151
"select": {
5252
"borderRadius": "12px",

‎gitpagelayouts/templates/arctic-light.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"borderRadius": "12px",
4747
"padding": "10px 18px",
4848
"border": "1px solid #D6E8F5",
49-
"hoverGlow": "0 0 0 4px rgba(109, 40, 217, 0.15)"
49+
"hoverGlow": "0 0 0 3px rgba(2, 132, 199, 0.18)"
5050
},
5151
"select": {
5252
"borderRadius": "12px",

‎gitpagelayouts/templates/aurora-light.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"borderRadius": "12px",
4747
"padding": "10px 18px",
4848
"border": "1px solid #E2E8F0",
49-
"hoverGlow": "0 0 0 4px rgba(109, 40, 217, 0.15)"
49+
"hoverGlow": "0 0 0 3px rgba(109, 40, 217, 0.18)"
5050
},
5151
"select": {
5252
"borderRadius": "12px",

‎gitpagelayouts/templates/azure-light.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"borderRadius": "12px",
4747
"padding": "10px 18px",
4848
"border": "1px solid #D0E2FB",
49-
"hoverGlow": "0 0 0 4px rgba(109, 40, 217, 0.15)"
49+
"hoverGlow": "0 0 0 3px rgba(37, 99, 235, 0.18)"
5050
},
5151
"select": {
5252
"borderRadius": "12px",

‎gitpagelayouts/templates/blush-light.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"borderRadius": "12px",
4747
"padding": "10px 18px",
4848
"border": "1px solid #FBD4E2",
49-
"hoverGlow": "0 0 0 4px rgba(109, 40, 217, 0.15)"
49+
"hoverGlow": "0 0 0 3px rgba(219, 39, 119, 0.18)"
5050
},
5151
"select": {
5252
"borderRadius": "12px",

‎gitpagelayouts/templates/coral-light.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"borderRadius": "12px",
4747
"padding": "10px 18px",
4848
"border": "1px solid #FBD9C8",
49-
"hoverGlow": "0 0 0 4px rgba(109, 40, 217, 0.15)"
49+
"hoverGlow": "0 0 0 3px rgba(249, 115, 22, 0.18)"
5050
},
5151
"select": {
5252
"borderRadius": "12px",

‎gitpagelayouts/templates/cyberpunk-light.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"borderRadius": "12px",
4747
"padding": "10px 18px",
4848
"border": "1px solid #F5D0FE",
49-
"hoverGlow": "0 0 0 4px rgba(109, 40, 217, 0.15)"
49+
"hoverGlow": "0 0 0 3px rgba(219, 39, 119, 0.18)"
5050
},
5151
"select": {
5252
"borderRadius": "12px",

‎gitpagelayouts/templates/default.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"borderRadius": "12px",
4747
"padding": "10px 18px",
4848
"border": "1px solid #E2E8F0",
49-
"hoverGlow": "0 0 0 4px rgba(109, 40, 217, 0.15)"
49+
"hoverGlow": "0 0 0 3px rgba(14, 165, 233, 0.18)"
5050
},
5151
"select": {
5252
"borderRadius": "12px",

0 commit comments

Comments
 (0)