hexo-theme-stellar/layout/index_topic.ejs

28 lines
693 B
Plaintext
Raw Permalink Normal View History

2024-01-14 14:10:36 +08:00
<%
function layout_topic_list(partial) {
var el = ''
const { publish_list, tree } = theme.topic
for (let id of publish_list) {
const topic = tree[id]
if (topic == null) {
continue
}
el += `<div class="post-list wiki topic">`
2024-01-19 01:05:44 +08:00
el += `<a class="post-card wiki topic${scrollreveal(' ')}" href="${url_for(topic.homepage?.path || '/')}">`
2024-01-14 14:10:36 +08:00
el += partial(topic)
el += `</a>`
el += `</div>`
}
return el
}
function layoutDiv() {
var el = ''
2024-01-14 16:42:20 +08:00
el += partial('_partial/main/navbar/nav_tabs_blog')
2024-01-14 14:10:36 +08:00
el += layout_topic_list(function(topic) {
return partial('_partial/main/post_list/topic_card', {topic: topic})
})
return el
}
%>
<%- layoutDiv() %>