From ea12ea0c038e222465e2dd0b69e49d63e5536f6b Mon Sep 17 00:00:00 2001 From: zhonger Date: Wed, 27 Mar 2024 17:19:16 +0900 Subject: [PATCH] [Features] Add submenu support for posts and optimize related codes --- _data/collections.yml | 11 ++ _includes/footer.html | 51 ++++--- _includes/submenu.html | 20 +++ _layouts/default.html | 2 +- _layouts/post.html | 62 +------- _posts/2021-12-22-new-theme-h2o-ac.md | 1 + assets/css/app.min.css | 198 +++++++++++++++++++------- assets/css/app.min.css.map | 2 +- assets/js/app.min.js | 42 +++--- assets/js/app.min.js.map | 2 +- dev/js/index.js | 42 +++--- dev/sass/helper.scss | 1 + dev/sass/layouts.scss | 64 ++++++--- dev/sass/night.scss | 14 +- dev/sass/post.scss | 172 +++++++++++++++++----- dev/sass/theme.scss | 10 ++ dev/sass/tools.scss | 104 ++++++++------ 17 files changed, 536 insertions(+), 262 deletions(-) create mode 100644 _data/collections.yml create mode 100644 _includes/submenu.html diff --git a/_data/collections.yml b/_data/collections.yml new file mode 100644 index 000000000..51c4f76ff --- /dev/null +++ b/_data/collections.yml @@ -0,0 +1,11 @@ +- id: 'begin' + name: 'H2O-ac 主题入门系列' + articles: + - name: '快速入门' + url: '/tech/new-theme-h2o-ac.html' + - name: '快速入门' + url: '/tech/new-theme-h2o-ac.html' + - name: '快速入门' + url: '/tech/new-theme-h2o-ac.html' + + \ No newline at end of file diff --git a/_includes/footer.html b/_includes/footer.html index 989f4548b..cc1d36cf4 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -90,26 +90,33 @@ - - +
+ {% if page.submenu %} +
+ + +
+ {% endif %} + {% if page.content contains 'h1' or page.content contains 'h2' or page.content contains 'h3' or page.content contains 'h4' or page.content contains 'h5' or page.content contains 'h6' and site.toc %} +
+ + +
+ {% endif %} +
+
+
+ +
+
\ No newline at end of file diff --git a/_includes/submenu.html b/_includes/submenu.html new file mode 100644 index 000000000..4ae26cc35 --- /dev/null +++ b/_includes/submenu.html @@ -0,0 +1,20 @@ +{% if page.submenu %} +