Skip to content

Commit 0768eba

Browse files
committed
deploy: bee5a10
1 parent 02c6850 commit 0768eba

Some content is hidden

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

45 files changed

+85
-117
lines changed

.doctrees/environment.pickle

0 Bytes
Binary file not shown.

_examples_synced/fully_async/README.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<script src="../../_static/scripts/sphinx-book-theme.js?v=887ef09a"></script>
4747
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
4848
<script>DOCUMENTATION_OPTIONS.pagename = '_examples_synced/fully_async/README';</script>
49-
<script src="../../_static/js/lang-toggle.js?v=cef81ec5"></script>
49+
<script src="../../_static/js/lang-toggle.js?v=8d03b7be"></script>
5050
<link rel="icon" href="../../_static/logo.ico"/>
5151
<link rel="index" title="Index" href="../../genindex.html" />
5252
<link rel="search" title="Search" href="../../search.html" />

_examples_synced/multi_agent/README.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<script src="../../_static/scripts/sphinx-book-theme.js?v=887ef09a"></script>
4747
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
4848
<script>DOCUMENTATION_OPTIONS.pagename = '_examples_synced/multi_agent/README';</script>
49-
<script src="../../_static/js/lang-toggle.js?v=cef81ec5"></script>
49+
<script src="../../_static/js/lang-toggle.js?v=8d03b7be"></script>
5050
<link rel="icon" href="../../_static/logo.ico"/>
5151
<link rel="index" title="Index" href="../../genindex.html" />
5252
<link rel="search" title="Search" href="../../search.html" />

_examples_synced/retool/README.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<script src="../../_static/scripts/sphinx-book-theme.js?v=887ef09a"></script>
4747
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
4848
<script>DOCUMENTATION_OPTIONS.pagename = '_examples_synced/retool/README';</script>
49-
<script src="../../_static/js/lang-toggle.js?v=cef81ec5"></script>
49+
<script src="../../_static/js/lang-toggle.js?v=8d03b7be"></script>
5050
<link rel="icon" href="../../_static/logo.ico"/>
5151
<link rel="index" title="Index" href="../../genindex.html" />
5252
<link rel="search" title="Search" href="../../search.html" />

_examples_synced/search-r1/README.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<script src="../../_static/scripts/sphinx-book-theme.js?v=887ef09a"></script>
4747
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
4848
<script>DOCUMENTATION_OPTIONS.pagename = '_examples_synced/search-r1/README';</script>
49-
<script src="../../_static/js/lang-toggle.js?v=cef81ec5"></script>
49+
<script src="../../_static/js/lang-toggle.js?v=8d03b7be"></script>
5050
<link rel="icon" href="../../_static/logo.ico"/>
5151
<link rel="index" title="Index" href="../../genindex.html" />
5252
<link rel="search" title="Search" href="../../search.html" />

_static/js/lang-toggle.js

Lines changed: 22 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
// Inject a language toggle button into the topbar (sphinx-book-theme compatible)
22
(function(){
33
const STORAGE_KEY = 'slime-doc-lang';
4-
const AVAILABLE = ['en','zh'];
4+
// Default language EN has no URL prefix; Chinese uses '/zh/' inserted after optional repo root.
55
function detectCurrent(){
6-
const { parts, langIndex } = analyzePath();
7-
if(langIndex !== -1) return parts[langIndex];
8-
return 'en';
6+
const { zhIndex } = analyzePath();
7+
return zhIndex !== -1 ? 'zh' : 'en';
98
}
10-
function otherLang(lang){ return lang === 'en' ? 'zh' : 'en'; }
9+
function otherLang(lang){ return lang === 'zh' ? 'en' : 'zh'; }
1110
/**
1211
* Analyze current pathname to figure out repo root + language segment pattern.
1312
* Supports patterns:
@@ -18,50 +17,35 @@
1817
*/
1918
function analyzePath(){
2019
const rawParts = window.location.pathname.split('/').filter(Boolean);
21-
let parts = rawParts.slice();
20+
const parts = rawParts.slice();
2221
let repoRoot = null;
23-
let langIndex = -1;
24-
25-
if(parts[0] && AVAILABLE.includes(parts[0])){
26-
langIndex = 0; // /en/...
27-
} else if(parts.length > 1 && AVAILABLE.includes(parts[1])){
22+
if(parts.length > 0 && (window.location.host.endsWith('github.io') || parts[0] === 'slime')){
2823
repoRoot = parts[0];
29-
langIndex = 1; // /slime/en/...
30-
} else {
31-
// No explicit language; try to detect repo root (GitHub Pages typical) so we insert AFTER it.
32-
// Heuristic: if host ends with github.io OR first segment matches known repo name 'slime'.
33-
if(parts.length > 0 && (window.location.host.endsWith('github.io') || parts[0] === 'slime')){
34-
repoRoot = parts[0];
35-
}
3624
}
37-
return { parts, repoRoot, langIndex };
25+
let zhIndex = -1;
26+
if(parts[0] === 'zh') zhIndex = 0; else if(parts[1] === 'zh') zhIndex = 1;
27+
return { parts, repoRoot, zhIndex };
3828
}
3929

4030
function buildTargetUrl(target){
4131
const url = new URL(window.location.href);
4232
const trailingSlash = url.pathname.endsWith('/') || url.pathname === '/';
43-
const { parts, repoRoot, langIndex } = analyzePath();
44-
45-
if(langIndex === 0){
46-
// replace first
47-
parts[0] = target;
48-
} else if(langIndex === 1){
49-
parts[1] = target; // replace second (/repo/en/)
50-
} else if(repoRoot){
51-
// insert after repo root
52-
if(parts.length === 1){
53-
parts.push(target); // /repo/ -> /repo/zh/
54-
} else {
55-
parts.splice(1, 0, target);
33+
const { parts, repoRoot, zhIndex } = analyzePath();
34+
if(target === 'zh'){
35+
if(zhIndex === -1){
36+
if(repoRoot){
37+
if(parts.length === 1) parts.push('zh'); else parts.splice(1,0,'zh');
38+
} else {
39+
parts.unshift('zh');
40+
}
5641
}
57-
} else {
58-
// no repo root detected; put language first
59-
parts.unshift(target);
42+
} else { // target en => remove zh if present
43+
if(zhIndex !== -1) parts.splice(zhIndex,1);
6044
}
61-
6245
let newPath = '/' + parts.join('/');
63-
// Add trailing slash if original had it and new path doesn't look like a file (no extension)
64-
if(trailingSlash && !/\.[a-zA-Z0-9]+$/.test(parts[parts.length-1] || '')) newPath += '/';
46+
if(newPath === '/') {
47+
// stay root
48+
} else if(trailingSlash && !/\.[a-zA-Z0-9]+$/.test(parts[parts.length-1] || '')) newPath += '/';
6549
url.pathname = newPath;
6650
return url.toString();
6751
}

advanced/speculative-decoding.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<script src="../_static/scripts/sphinx-book-theme.js?v=887ef09a"></script>
4747
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
4848
<script>DOCUMENTATION_OPTIONS.pagename = 'advanced/speculative-decoding';</script>
49-
<script src="../_static/js/lang-toggle.js?v=cef81ec5"></script>
49+
<script src="../_static/js/lang-toggle.js?v=8d03b7be"></script>
5050
<link rel="icon" href="../_static/logo.ico"/>
5151
<link rel="index" title="Index" href="../genindex.html" />
5252
<link rel="search" title="Search" href="../search.html" />

blogs/introducing_slime.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<script src="../_static/scripts/sphinx-book-theme.js?v=887ef09a"></script>
4747
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
4848
<script>DOCUMENTATION_OPTIONS.pagename = 'blogs/introducing_slime';</script>
49-
<script src="../_static/js/lang-toggle.js?v=cef81ec5"></script>
49+
<script src="../_static/js/lang-toggle.js?v=8d03b7be"></script>
5050
<link rel="icon" href="../_static/logo.ico"/>
5151
<link rel="index" title="Index" href="../genindex.html" />
5252
<link rel="search" title="Search" href="../search.html" />

blogs/release_v0.1.0.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<script src="../_static/scripts/sphinx-book-theme.js?v=887ef09a"></script>
4747
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
4848
<script>DOCUMENTATION_OPTIONS.pagename = 'blogs/release_v0.1.0';</script>
49-
<script src="../_static/js/lang-toggle.js?v=cef81ec5"></script>
49+
<script src="../_static/js/lang-toggle.js?v=8d03b7be"></script>
5050
<link rel="icon" href="../_static/logo.ico"/>
5151
<link rel="index" title="Index" href="../genindex.html" />
5252
<link rel="search" title="Search" href="../search.html" />

developer_guide/debug.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
<script src="../_static/scripts/sphinx-book-theme.js?v=887ef09a"></script>
4747
<script crossorigin="anonymous" integrity="sha256-Ae2Vz/4ePdIu6ZyI/5ZGsYnb+m0JlOmKPjt6XZ9JJkA=" src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.4/require.min.js"></script>
4848
<script>DOCUMENTATION_OPTIONS.pagename = 'developer_guide/debug';</script>
49-
<script src="../_static/js/lang-toggle.js?v=cef81ec5"></script>
49+
<script src="../_static/js/lang-toggle.js?v=8d03b7be"></script>
5050
<link rel="icon" href="../_static/logo.ico"/>
5151
<link rel="index" title="Index" href="../genindex.html" />
5252
<link rel="search" title="Search" href="../search.html" />

0 commit comments

Comments
 (0)