diff --git a/layout/common/nav.ejs b/layout/common/nav.ejs index 7c6e7e7..d87e636 100644 --- a/layout/common/nav.ejs +++ b/layout/common/nav.ejs @@ -1,15 +1,5 @@ - - + diff --git a/scripts/helpers/export-config.js b/scripts/helpers/export-config.js index 8c06341..1e8e0ac 100644 --- a/scripts/helpers/export-config.js +++ b/scripts/helpers/export-config.js @@ -14,7 +14,8 @@ hexo.extend.helper.register('export_config', function() { root : config.root, localsearch: theme.local_search, themeName: theme.theme_name, - themeVersion: theme.theme_version + themeVersion: theme.theme_version, + pageLayout: theme.page }; if (config.search) { exportConfig.path = config.search.path; diff --git a/source/js/main.js b/source/js/main.js index 97cf980..8a0744d 100644 --- a/source/js/main.js +++ b/source/js/main.js @@ -1,3 +1,11 @@ window.addEventListener('DOMContentLoaded', () => { console.log(`${CONFIG.themeName} v${CONFIG.themeVersion}`); + + let isOpenLeftSide = true; + document.querySelector('.fold-left-side-btn').addEventListener('click', () => { + document.querySelector('.page-left').style.display = isOpenLeftSide ? 'none' : 'block'; + document.querySelector('.page-right').style.width = isOpenLeftSide ? '100%' : `${CONFIG.pageLayout.right_side_width}%`; + isOpenLeftSide = !isOpenLeftSide; + }); + }); \ No newline at end of file