diff --git a/layout/_partial/head.ejs b/layout/_partial/head.ejs index 2dbff1f..b3aa753 100644 --- a/layout/_partial/head.ejs +++ b/layout/_partial/head.ejs @@ -23,9 +23,7 @@ <%= theme.base_info.title || config.title || 'ILS' %> - <% if (theme.style.favicon){ %> - <%- favicon_tag(theme.style.favicon) %> - <% } %> + <%- favicon_tag('images/favicon.png') %> <%- css('css/style') %> <%- export_config() %> diff --git a/layout/article-content.ejs b/layout/article-content.ejs index 29dcb33..3250518 100644 --- a/layout/article-content.ejs +++ b/layout/article-content.ejs @@ -5,10 +5,10 @@ <%= page.title %> - <% if (theme.style.avatar && (theme.base_info.author || config.author)) { %> + <% if (theme.base_info.author || config.author) { %>
- <%- image_tag(theme.style.avatar) %> + <%- image_tag('images/avatar.png') %>
diff --git a/scripts/helpers/export-config.js b/scripts/helpers/export-config.js index 4a9d446..ca1cf95 100644 --- a/scripts/helpers/export-config.js +++ b/scripts/helpers/export-config.js @@ -16,7 +16,8 @@ hexo.extend.helper.register('export_config', function () { codeblock: theme.codeblock, toc: theme.toc, back2top: theme.back2top, - side_tools: theme.side_tools + side_tools: theme.side_tools, + style: theme.style }; if (config.search) { exportConfig.path = config.search.path; diff --git a/source/css/layout/common/markdown.styl b/source/css/layout/common/markdown.styl index 07df457..93da1e1 100644 --- a/source/css/layout/common/markdown.styl +++ b/source/css/layout/common/markdown.styl @@ -144,10 +144,17 @@ img { box-sizing: initial; padding: 2px; - margin: 2px 0; max-width: 100%; border: 1px solid var(--border-color); cursor: pointer; + display: block; + + if (hexo-config('style.img_position') == 'center') { + margin: 2px auto; + } else { + margin: 2px 0; + } + } & > table { diff --git a/source/css/layout/common/variables.styl b/source/css/layout/common/variables.styl index 74a064e..b57d9d4 100644 --- a/source/css/layout/common/variables.styl +++ b/source/css/layout/common/variables.styl @@ -49,7 +49,8 @@ $z-index-9 = 1009; // color // ======================================================================== // primary color -$primary-color = convert(hexo-config("style.primary_color")) || #0066CC; +$temp-color = hexo-config('style.primary_color'); +$primary-color = $temp-color ? convert($temp-color) : #0066CC; $background-color = #fff; // light background color $second-background-color = darken($background-color, 2%); // second light background color $normal-text-color = #383838; // 通用文本颜色(默认字体颜色) diff --git a/source/css/layout/page.styl b/source/css/layout/page.styl index 849b31b..409fedf 100644 --- a/source/css/layout/page.styl +++ b/source/css/layout/page.styl @@ -2,7 +2,8 @@ @require "./common/animated.styl"; $header-progress-height = 3px; -$page-aside-width = 258px; +$temp-width = hexo-config('style.left_side_width'); +$page-aside-width = $temp-width ? convert($temp-width) : 260px; .page-container { diff --git a/source/js/left-side-toggle.js b/source/js/left-side-toggle.js index 242e65d..d9d15ec 100644 --- a/source/js/left-side-toggle.js +++ b/source/js/left-side-toggle.js @@ -30,7 +30,7 @@ window.addEventListener('DOMContentLoaded', () => { }, changePageLayoutWhenOpenToggle(isOpen) { - const pageAsideWidth = '258px'; + const pageAsideWidth = CONFIG.style.left_side_width || '260px'; this.containerDom.style.paddingLeft = isOpen ? pageAsideWidth : '0'; this.pageTopDom.style.paddingLeft = isOpen ? pageAsideWidth : '0'; this.leftAsideDom.style.left = isOpen ? '0' : `-${pageAsideWidth}`;