From 6bd928d8db180774b87d8e76dd73e0ccc741c27f Mon Sep 17 00:00:00 2001 From: cxykevin Date: Sun, 11 Aug 2024 15:02:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=8B=E6=9C=BA=E7=AB=AF?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=B1=95=E5=BC=80=E8=8F=9C=E5=8D=95=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20(#15)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-on: https://git.hmtsai.cn/study-area-cn/study-area-cn/pulls/15 --- book.toml | 1 + theme/index.hbs | 4 +++- theme/js/page.js | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 theme/js/page.js diff --git a/book.toml b/book.toml index 861d5f2..eaeb4f8 100755 --- a/book.toml +++ b/book.toml @@ -18,4 +18,5 @@ additional-js = [ "theme/js/highlight.min.js", "theme/js/mathjax.js", "theme/js/tocrender.js", + "theme/js/page.js", ] diff --git a/theme/index.hbs b/theme/index.hbs index d61aa55..50c96ab 100755 --- a/theme/index.hbs +++ b/theme/index.hbs @@ -84,7 +84,7 @@ {{/if}} - + {{/unless}} @@ -201,6 +201,8 @@ + + \ No newline at end of file diff --git a/theme/js/page.js b/theme/js/page.js new file mode 100644 index 0000000..7597071 --- /dev/null +++ b/theme/js/page.js @@ -0,0 +1,3 @@ +if (window.innerWidth > 640) { + document.getElementById("toc-drawer").setAttribute('open', true) +}