You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1074f5e
Browse filesBrowse the repository at this point in the historyBrowse files
feat(config): compact gitpagedocs config without repeated values
- config.json stores the header icons as site.icons (defaults + one entry per
icon with its tag and differences) instead of 279 flat Icon* keys
(16 KB -> 5.4 KB); version configs keep the settings every route shares in
routeDefaults (26.5 KB -> 18.5 KB).
- New browser-safe @gitpagedocs/tools/config-format with inverse pairs
compactSiteIcons/expandSiteIcons and factorRouteDefaults/applyRouteDefaults.
The generator compacts on write; the viewer expands in withConfigDefaults and
in both version-config readers (shared browser-safe expandVersionConfig); the
site baseline stays flat.
- Flat 0.0.x configs keep working; a flat key or a value on a route wins over
the compact form. Input that is not an object is returned as is.
- Round-trip tests over the generated files, viewer tests for both formats,
docs templates (en/pt/es), README and CHANGELOG describe the format.
Copy file name to clipboardExpand all lines: cli/content/docs-en.mjs
+4Lines changed: 4 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -391,6 +391,10 @@ Version configs support multiple content types:
391
391
392
392
Each route can include \`title\`, \`description\` (per language), \`titleCss\`, \`titlePosition: "center"\`, \`descriptionPosition: "center"\`, \`titleIsVisible\`, \`descriptionIsVisible\`.
393
393
394
+
Settings every route shares are written once in \`routeDefaults\` at the top of the version config; each route keeps only its own values, and a value written on a route wins over \`routeDefaults\`.
395
+
396
+
Header icons live in \`site.icons\`: \`defaults\` holds what all icons share (\`reactIcon\`, \`colorDark\`, \`colorLight\`, \`size\`, \`imgDark\`, \`imgLight\`, \`imgWidth\`, \`imgHeight\`) and each icon entry sets its \`tag\` plus any difference (\`null\` removes a field). The older flat keys (\`IconNavMenuOpenReactIconesTag\`, …) still work and win when both are present.
- \`icons\`: iconos de la cabecera. \`icons.defaults\` guarda lo que todos comparten (\`reactIcon\`, \`colorDark\`, \`colorLight\`, \`size\`, \`imgDark\`, \`imgLight\`, \`imgWidth\`, \`imgHeight\`) y cada icono define su \`tag\` y lo que cambia (\`null\` quita un campo). Las claves planas de abajo siguen valiendo y ganan cuando existen ambas formas.
208
209
- \`IconImageMenuHeaderImgWidth\`, \`IconImageMenuHeaderImgHeight\`: tamano del icono principal
209
210
- \`IconImageMenuHeaderLightImg\`, \`IconImageMenuHeaderDarkImg\`: icono principal (light/dark)
210
211
- \`IconProjectLinkImgWidth\`, \`IconProjectLinkImgHeight\`: tamano del icono enlace del proyecto
@@ -256,6 +257,8 @@ Los configs de version soportan multiples tipos:
256
257
257
258
Cada ruta puede incluir \`title\`, \`description\` (por idioma), \`titleCss\`, \`titlePosition: "center"\`, \`descriptionPosition: "center"\`, \`titleIsVisible\`, \`descriptionIsVisible\`.
258
259
260
+
Los ajustes que comparten todas las rutas se escriben una sola vez en \`routeDefaults\`, al inicio del config de la version; cada ruta guarda solo sus propios valores, y un valor escrito en la ruta gana sobre \`routeDefaults\`.
261
+
259
262
## Variables por ruta (blockLink, container, url, browseAll)
260
263
261
264
Opciones por ruta en \`routes-md\`, \`routes-html\` y \`routes-video\`:
Copy file name to clipboardExpand all lines: cli/content/docs-pt.mjs
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -205,6 +205,7 @@ Principais chaves:
205
205
- \`docsVersion\`: versao inicial selecionada
206
206
- \`ActiveNavigation\`: habilita comportamento de anterior/proximo
207
207
- \`FocusMode\`: habilita modo foco/leitura
208
+
- \`icons\`: icones do cabecalho. \`icons.defaults\` guarda o que todos compartilham (\`reactIcon\`, \`colorDark\`, \`colorLight\`, \`size\`, \`imgDark\`, \`imgLight\`, \`imgWidth\`, \`imgHeight\`) e cada icone define seu \`tag\` e o que muda (\`null\` remove um campo). As chaves planas abaixo continuam valendo e vencem quando as duas formas existem.
208
209
- \`IconImageMenuHeaderImgWidth\`, \`IconImageMenuHeaderImgHeight\`: tamanho do icone principal
209
210
- \`IconImageMenuHeaderLightImg\`, \`IconImageMenuHeaderDarkImg\`: icone principal (light/dark)
210
211
- \`IconProjectLinkImgWidth\`, \`IconProjectLinkImgHeight\`: tamanho do icone link do projeto
@@ -256,6 +257,8 @@ Configs de versao suportam multiplos tipos:
256
257
257
258
Cada rota pode incluir \`title\`, \`description\` (por idioma), \`titleCss\`, \`titlePosition: "center"\`, \`descriptionPosition: "center"\`, \`titleIsVisible\`, \`descriptionIsVisible\`.
258
259
260
+
Configuracoes que todas as rotas compartilham ficam uma unica vez em \`routeDefaults\`, no topo do config da versao; cada rota guarda so os proprios valores, e um valor escrito na rota vence o \`routeDefaults\`.
261
+
259
262
## Variaveis por rota (blockLink, container, url, browseAll)
260
263
261
264
Opcoes por rota em \`routes-md\`, \`routes-html\` e \`routes-video\`:
0 commit comments