feat: add img_position and left_side_width in _config.yml
This commit is contained in:
parent
1a240b0e28
commit
7318cae1bb
|
@ -23,9 +23,7 @@
|
|||
<%= theme.base_info.title || config.title || 'ILS' %>
|
||||
</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<% if (theme.style.favicon){ %>
|
||||
<%- favicon_tag(theme.style.favicon) %>
|
||||
<% } %>
|
||||
<%- favicon_tag('images/favicon.png') %>
|
||||
<%- css('css/style') %>
|
||||
<%- export_config() %>
|
||||
</head>
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
<span class="title-hover-animation"><%= page.title %></span>
|
||||
</div>
|
||||
|
||||
<% if (theme.style.avatar && (theme.base_info.author || config.author)) { %>
|
||||
<% if (theme.base_info.author || config.author) { %>
|
||||
<div class="article-header">
|
||||
<div class="avatar">
|
||||
<%- image_tag(theme.style.avatar) %>
|
||||
<%- image_tag('images/avatar.png') %>
|
||||
</div>
|
||||
<div class="info">
|
||||
<div class="author">
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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; // 通用文本颜色(默认字体颜色)
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
|
@ -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}`;
|
||||
|
|
Loading…
Reference in New Issue