fi3ework / hexo-theme-archer

🎯 A smart and modern theme for Hexo.
https://fi3ework.github.io/hexo-theme-archer
MIT License
1.49k stars 274 forks source link

版权信息中的时间格式 #342

Closed lulu010722 closed 1 year ago

lulu010722 commented 1 year ago

版权信息部分,创建日期和更新日期的时间格式不一样。

在本地hexo s之后,会出现这问题。出现问题的博客,front matter里面没有设置updated字段,是根据hexo自动填充的mtime。 而且这个问题是有时会出现,有时不会出现。

image

lulu010722 commented 1 year ago

已经解决了 在themes\archer\layout\post.ejs中更改

    <% if(theme.copyright.enable === true && page.copyright !== false) { %>
        <div class="license-wrapper">
            <p><%- __('author') %>:<a href="<%- config.url %>"><%- config.author %></a>
            <p><%- __('post_link') %>:<a href="<%- page.permalink %>"><%- page.permalink %></a>
            <!-- 可以根据moment的format用法自由更换格式 -->
            <p><%- __('publish_date') %>:<a href="<%- page.permalink %>"><%- (page.date).format('YYYY-MM-DD HH:mm:ss') %></a>
            <p><%- __('update_date') %>:<a href="<%- page.permalink %>"><%- (page.updated).format('YYYY-MM-DD HH:mm:ss') %></a>
            <p><%- __('license') %>:<%- theme.copyright.license %></p>
        </div>
    <% } %>