hexo-theme-stellar/layout/_partial/main/navbar/dateinfo.ejs

31 lines
1.1 KiB
Plaintext
Raw Normal View History

2024-01-20 01:51:09 +08:00
<%
function layoutDiv() {
// 作者
var el = ''
2024-01-31 13:58:56 +08:00
el += `<div class="flex-row" id="post-meta">`
2024-01-20 01:51:09 +08:00
if (page.wiki) {
2024-01-31 13:58:56 +08:00
el += `<span class="text created">${__("meta.updated") + __("symbol.colon")}`
2024-01-20 01:51:09 +08:00
el += `<time datetime="${date_xml(page.updated)}">${date(page.updated, config.date_format)}</time>`
el += `</span>`
} else {
2024-01-31 13:58:56 +08:00
const author = theme.authors ? (theme.authors[page.author] || theme.default_author) : null
if (author) {
el += `<a class="author" href="${url_for(author.path)}">${author.name}</a>`
el += `<span class="sep"></span>`
}
2024-01-20 01:51:09 +08:00
// 发布日期
2024-01-31 22:45:07 +08:00
el += `<span class="text created">`
2024-01-20 01:51:09 +08:00
el += `<time datetime="${date_xml(page.date)}">${date(page.date, config.date_format)}</time>`
el += `</span>`
// 更新日期
2024-01-31 13:58:56 +08:00
el += `<span class="sep updated"></span>`
el += `<span class="text updated">`
2024-01-30 23:48:00 +08:00
el += `${__("meta.updated") + __("symbol.colon")}`
2024-01-20 01:51:09 +08:00
el += `<time datetime="${date_xml(page.updated)}">${date(page.updated, config.date_format)}</time>`
el += `</span>`
}
el += `</div>`
return el
}
%>
<%- layoutDiv() %>