Files
docs/root/index.html
T
ErickSkrauch b128b92941 Preserve URLs of the old Sphinx-based documentation
Build each locale into its own prefix (/ru/, /en/) with trailingSlash: false,
so pages are generated as build/<locale>/<page>.html exactly like the old
documentation and the existing URLs (e.g. /ru/api.html) keep working on
GitHub Pages without any redirects.

The site root is assembled by the postbuild script:
- index.html redirects to /ru/ or /en/ based on the browser language
- 404.html is copied from the default locale (GitHub Pages only uses the root one)
- CNAME, .nojekyll and robots.txt pointing to per-locale sitemaps
2026-10-28 18:38:44 +01:00

38 lines
1.2 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Ely.by Documentation</title>
<link rel="alternate" hreflang="ru" href="https://docs.ely.by/ru/">
<link rel="alternate" hreflang="en" href="https://docs.ely.by/en/">
<link rel="alternate" hreflang="x-default" href="https://docs.ely.by/ru/">
<script>
(function () {
var ruLike = ['ru', 'be', 'uk', 'kk'];
var languages = navigator.languages || [navigator.language || ''];
var target = '/en/';
for (var i = 0; i < languages.length; i++) {
var lang = String(languages[i]).toLowerCase().split('-')[0];
if (ruLike.indexOf(lang) !== -1) {
target = '/ru/';
break;
}
if (lang === 'en') {
break;
}
}
window.location.replace(target + window.location.search + window.location.hash);
})();
</script>
</head>
<body>
<ul>
<li><a href="/ru/" hreflang="ru">Документация Ely.by на русском</a></li>
<li><a href="/en/" hreflang="en">Ely.by documentation in English</a></li>
</ul>
</body>
</html>