From cc6777b6e93f1059d91e84824ffa68402ebc257c Mon Sep 17 00:00:00 2001 From: XPoet Date: Wed, 25 Nov 2020 16:54:44 +0800 Subject: [PATCH] refactor: refactoring side tools && add font size adjust --- _config.yml | 16 +--- layout/_partial/scripts.ejs | 12 +-- layout/_partial/side-tools-container.ejs | 35 ++++++++ layout/_partial/tools2.ejs | 32 ------- layout/page.ejs | 9 +- source/css/layout/_partial/first-screen.styl | 6 +- .../layout/_partial/side-tools-container.styl | 51 +++++++++++ source/css/layout/_partial/tools2.styl | 88 ------------------- source/css/layout/article-content.styl | 2 +- source/css/layout/page.styl | 30 ++----- source/css/style.styl | 2 +- source/js/back2top.js | 28 +++--- source/js/dark-light-toggle.js | 6 +- source/js/header-shrink.js | 15 ++-- source/js/local-search.js | 14 ++- source/js/main.js | 7 +- source/js/utils.js | 49 +++++------ 17 files changed, 163 insertions(+), 239 deletions(-) create mode 100644 layout/_partial/side-tools-container.ejs delete mode 100644 layout/_partial/tools2.ejs create mode 100644 source/css/layout/_partial/side-tools-container.styl delete mode 100644 source/css/layout/_partial/tools2.styl diff --git a/_config.yml b/_config.yml index 5d1848f..ef13b17 100644 --- a/_config.yml +++ b/_config.yml @@ -153,20 +153,6 @@ code_copy: style: default # values: default | mac -# --------------------------------------------------------------------------------------- -# Sidebar tools -# --------------------------------------------------------------------------------------- -side_tools: - enable: false - - -# --------------------------------------------------------------------------------------- -# Back to top -# --------------------------------------------------------------------------------------- -back2top: - enable: true - - # --------------------------------------------------------------------------------------- # Table of Contents in the Sidebar # --------------------------------------------------------------------------------------- @@ -181,7 +167,7 @@ toc: # --------------------------------------------------------------------------------------- -# # Post copyright info +# Post copyright info # --------------------------------------------------------------------------------------- copyright_info: enable: true diff --git a/layout/_partial/scripts.ejs b/layout/_partial/scripts.ejs index 7e9a2f0..eb63ec2 100644 --- a/layout/_partial/scripts.ejs +++ b/layout/_partial/scripts.ejs @@ -1,17 +1,11 @@ <%- __js([ 'js/utils.js', + 'js/main.js', 'js/header-shrink.js', - 'js/main.js' + 'js/back2top.js', + 'js/dark-light-toggle.js' ]) %> -<% if (theme.side_tools.enable) { %> - <%- __js('js/dark-light-toggle.js') %> - - <% if (theme.back2top.enable) { %> - <%- __js('js/back2top.js') %> - <% } %> -<% } %> - <% if (theme.local_search.enable) { %> <%- __js('js/local-search.js') %> <% } %> diff --git a/layout/_partial/side-tools-container.ejs b/layout/_partial/side-tools-container.ejs new file mode 100644 index 0000000..9f0730f --- /dev/null +++ b/layout/_partial/side-tools-container.ejs @@ -0,0 +1,35 @@ +
+ + + + +
diff --git a/layout/_partial/tools2.ejs b/layout/_partial/tools2.ejs deleted file mode 100644 index 6140d1d..0000000 --- a/layout/_partial/tools2.ejs +++ /dev/null @@ -1,32 +0,0 @@ -
- - - - -
diff --git a/layout/page.ejs b/layout/page.ejs index 69a52c7..c49db0a 100644 --- a/layout/page.ejs +++ b/layout/page.ejs @@ -59,12 +59,9 @@ <%- partial('_partial/tools') %> - - <% if (theme.side_tools.enable) { %> -
- <%- partial('_partial/tools2') %> -
- <% } %> +
+ <%- partial('_partial/side-tools-container') %> +