We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8e8ac3a commit 2922089Copy full SHA for 2922089
main.js
@@ -36,7 +36,16 @@ const getLang = () => (isEn() ? 'en' : 'zh-CN');
36
const giscusTheme = () =>
37
localStorage.getItem('DARK_LIGHT_THEME') === 'light' ? 'light' : 'noborder_dark';
38
39
-const getTerm = () => decodeURI(location.hash.slice(1, location.hash.lastIndexOf('/')) || '/index');
+const getTerm = () => {
40
+ let path = decodeURI(location.hash.slice(1, location.hash.lastIndexOf('/'))) || '/index';
41
+ // restore original path
42
+ for (const prefix of ['javascript', 'database']) {
43
+ if (path.includes(prefix + '-solution')) {
44
+ path = path.replace(prefix + '-solution', 'solution');
45
+ }
46
47
+ return path;
48
+};
49
50
window.addEventListener('hashchange', () => {
51
window.$docsify.loadSidebar = sidebar();
0 commit comments