diff --git a/layout/_partial/comments/valine.ejs b/layout/_partial/comments/valine.ejs index 20041164..9fd491e5 100755 --- a/layout/_partial/comments/valine.ejs +++ b/layout/_partial/comments/valine.ejs @@ -19,13 +19,24 @@ }); - // Valine 评论列表增加"作者"标识 + // Valine 评论列表增加"博主"标识 const getValineDomTimer = setInterval(() => { const vcards = document.querySelectorAll('#vcomments .vcards .vcard'); if (vcards.length > 0) { + + let author = '<%= theme.base_info.author || config.author %>'; + if (author) { + author = author.toLocaleLowerCase(); + } + + let email = '<%= theme.base_info.email %>'; + if (email) { + email = email.toLocaleLowerCase(); + } + for (let vcard of vcards) { const vnick = vcard.querySelector('.vhead .vnick'); - if (vnick.innerHTML.toLocaleLowerCase() === '<%= config.author %>'.toLocaleLowerCase()) { + if (vnick.innerHTML.toLocaleLowerCase() === author) { vcard.classList.add('author'); } } diff --git a/layout/article-content.ejs b/layout/article-content.ejs index 1533c5c5..e0d0ff58 100644 --- a/layout/article-content.ejs +++ b/layout/article-content.ejs @@ -5,14 +5,14 @@ <%= page.title %> - <% if (theme.style.avatar && config.author) { %> + <% if (theme.style.avatar && (theme.base_info.author || config.author)) { %>
<%- image_tag(theme.style.avatar) %>
- <%= config.author %> + <%= theme.base_info.author || config.author %> Lv<%- getLevel(site.posts.length) %>
@@ -20,6 +20,12 @@
+ <% } else { %> +
+
+ <%- partial('_partial/article-meta-info', {articleObject: page, index: true}) %> +
+
<% } %>
diff --git a/source/css/layout/article-content.styl b/source/css/layout/article-content.styl index 7e1c5c24..9670175d 100644 --- a/source/css/layout/article-content.styl +++ b/source/css/layout/article-content.styl @@ -25,20 +25,13 @@ $avatarWidth = 46px; } } - .article-header { - margin-top: 16px; position: relative; padding-left: $avatarWidth; width: 100%; height: $avatarWidth; box-sizing: border-box; - +ils-tablet() { - transform: scale(0.9); - transform-origin: left top; - } - .avatar { position: absolute; top: 0 @@ -90,6 +83,15 @@ $avatarWidth = 46px; } + .article-header, + .article-header-meta-info { + margin-top: 16px; + +ils-tablet() { + transform: scale(0.88); + transform-origin: left top; + } + } + .article-content { margin-top: 30px; text-align: justify;