diff --git a/layout/_partial/comments/valine.ejs b/layout/_partial/comments/valine.ejs index 2004116..9fd491e 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 1533c5c..e0d0ff5 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)) { %>