fix(i18n): keep en navigation within /en/ via pagePrefix
- build-pages.mjs: add pagePrefix (locale-root-relative, no en offset) - use pagePrefix for nav links: logo, back-home, footer design-system/ cookie-policy/, FAB #contact, cookie-notice link, cookie-policy body link, case-page #skills/#projects anchors (assetPrefix pointed to site root and leaked en pages to ru) - docs/translation.md: document assetPrefix vs pagePrefix
This commit is contained in:
1 parent
1d25dcee47
commit
e02ce1c629
11 files changed
+20
-16
No files matched your search
@@ -165,6 +165,9 @@ function build() {
|
||||
const source = readUtf8(sourcePath);
|
||||
|
||||
const vars = baseVars(relNorm, depth);
|
||||
// Префикс до КОРНЯ ЛОКАЛИ (без en-сдвига) — для навигационных ссылок,
|
||||
// чтобы они вели в ту же локаль (/en/), а не в корень сайта (/).
|
||||
vars.pagePrefix = vars.assetPrefix;
|
||||
// Для не-дефолтной локали всё содержимое уходит на уровень глубже (public/<lang>/),
|
||||
// поэтому к assetPrefix добавляем один ../, а пустой casesPrefix — в ../cases/.
|
||||
if (!isDefault) {
|
||||
|
||||
Reference in new issue
Block a user