Skip to content

Commit 1d444d0

Browse files
committed
docs: update index page
1 parent 619a52b commit 1d444d0

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

README_EN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Complete solutions to [LeetCode](https://leetcode.com/problemset/all/), [LCOF](h
3838
- [Find the Student that Will Replace the Chalk](/solution/1800-1899/1894.Find%20the%20Student%20that%20Will%20Replace%20the%20Chalk/README_EN.md) - Binary search
3939
- [Maximum Number of Removable Characters](/solution/1800-1899/1898.Maximum%20Number%20of%20Removable%20Characters/README_EN.md) - Binary search
4040

41-
#### 2. Search
41+
### 2. Search
4242

4343
- [Flood Fill](/solution/0700-0799/0733.Flood%20Fill/README_EN.md) - BFS, DFS, Flood fill
4444
- [Number of Islands](/solution/0200-0299/0200.Number%20of%20Islands/README_EN.md) - BFS, Flood fill

index.html

+9-4
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,13 @@
2525
<div id="app">LeetCode & Coding Interview Guide @Doocs</div>
2626
<script>
2727
const isEn = () => location.hash.includes('README_EN');
28+
const isRoot = () => ['', '#/', '#/README', '#/README_EN'].includes(location.hash);
29+
const sidebar = () => isRoot() ? false : (isEn() ? 'summary_en.md' : 'summary.md');
30+
2831
window.addEventListener('hashchange', () => {
29-
window.$docsify.loadSidebar = isEn() ? 'summary_en.md' : 'summary.md'
32+
window.$docsify.loadSidebar = sidebar();
33+
window.$docsify.pagination.previousText = isEn() ? 'PREVIOUS' : '上一题';
34+
window.$docsify.pagination.nextText = isEn() ? 'NEXT' : '下一题';
3035
});
3136

3237
window.$docsify = {
@@ -36,7 +41,7 @@
3641
search: [
3742
'/', '/solution/', '/lcof/', '/lcof2/', '/lcci/', '/lcs/', '/lcp/', '/basic/'
3843
],
39-
loadSidebar: isEn() ? 'summary_en.md' : 'summary.md',
44+
loadSidebar: sidebar(),
4045
auto2top: true,
4146
subMaxLevel: 2,
4247
alias: {
@@ -80,8 +85,8 @@
8085
}
8186
},
8287
pagination: {
83-
previousText: '上一题',
84-
nextText: '下一题',
88+
previousText: isEn() ? 'PREVIOUS' : '上一题',
89+
nextText: isEn() ? 'NEXT' : '下一题',
8590
crossChapter: true,
8691
crossChapterText: true
8792
},

0 commit comments

Comments
 (0)