Files
2024-07-05 21:01:19 +08:00

32 lines
1.4 KiB
Plaintext

- var filteredPosts = site.posts.data.filter(item => item.recommend === true).slice(0,6)
.recent-post-group
each post in filteredPosts
.recent-post-item
.post_cover
a(href=url_for(post.path), title=post.title)
span.recent-post-top-text= _p('home.recommend')
img.post_bg(alt=post.title, src=post.cover)
.recent-post-info
a.article-title(href=url_for(post.path), title=post.title)= post.title
mixin todayCardContent
.todayCard-info
.todayCard-tips= theme.hometop.recommendList.sup
.todayCard-title= theme.hometop.recommendList.title
.todayCard-cover.nolazyload(style=`background: url('${theme.hometop.recommendList.img}') no-repeat center /cover`)
.banner-button-group
a.banner-button(onclick="window.event.cancelBubble=true;sco.hideTodayCard();")
i.solitude.st-add-fill
span.banner-button-text= _p('home.recommendmore')
case theme.hometop.recommendList.url.startsWith('/')
when true
.todayCard#todayCard(onclick=`pjax.loadUrl('${theme.hometop.recommendList.url}')`)
+todayCardContent()
when false
script.
function GoTodayCard() {
window.open("#{theme.hometop.recommendList.url}", "_blank");
}
.todayCard#todayCard(onclick="GoTodayCard()")
+todayCardContent()