hexo-theme-stellar/layout/index_topic.ejs

36 lines
842 B
Plaintext
Raw Normal View History

2024-01-14 14:10:36 +08:00
<%
if (page.menu_id == undefined) {
if (page.layout === 'wiki_topic' && page.topic) {
page.menu_id = 'blog'
} else {
page.menu_id = 'post'
}
}
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/list_post')
el += layout_topic_list(function(topic) {
return partial('_partial/main/post_list/topic_card', {topic: topic})
})
return el
}
%>
<%- layoutDiv() %>