hexo-theme-stellar/layout/index_topic.ejs

28 lines
691 B
Plaintext

<%
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">`
el += `<a class="post-card wiki topic ${scrollreveal()}" href="${url_for(topic.homepage?.path || '/')}">`
el += partial(topic)
el += `</a>`
el += `</div>`
}
return el
}
function layoutDiv() {
var el = ''
el += partial('_partial/main/navbar/nav_tabs_blog')
el += layout_topic_list(function(topic) {
return partial('_partial/main/post_list/topic_card', {topic: topic})
})
return el
}
%>
<%- layoutDiv() %>