From cdc2771f92f2d7f844330799d62365d395000e75 Mon Sep 17 00:00:00 2001 From: cxykevin Date: Sun, 11 Aug 2024 11:51:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E6=89=8B=E6=9C=BA=E7=AB=AF?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=B1=95=E5=BC=80=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 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) +}