mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2025-09-15 12:58:48 +08:00
添加系列文章目录
This commit is contained in:
parent
9a86429484
commit
08b7cd9dbb
@ -6,6 +6,9 @@
|
|||||||
else if (page.highlight_shrink === true || page.highlight_shrink === false) isHighlightShrink = page.highlight_shrink
|
else if (page.highlight_shrink === true || page.highlight_shrink === false) isHighlightShrink = page.highlight_shrink
|
||||||
else isHighlightShrink = theme.highlight_shrink
|
else isHighlightShrink = theme.highlight_shrink
|
||||||
|
|
||||||
|
if (page.series)
|
||||||
|
var Series = page.series
|
||||||
|
|
||||||
var showToc = false
|
var showToc = false
|
||||||
if (theme.aside.enable && page.aside !== false) {
|
if (theme.aside.enable && page.aside !== false) {
|
||||||
let tocEnable = false
|
let tocEnable = false
|
||||||
|
|||||||
15
layout/includes/widget/card_series_post.pug
Normal file
15
layout/includes/widget/card_series_post.pug
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
.card-widget(class='series_post' id='series_post')
|
||||||
|
.item-headline
|
||||||
|
i(class='fas fa-car-side')
|
||||||
|
span 系列文章 #{Series}
|
||||||
|
.item-content
|
||||||
|
- let list = site.posts.sort('date', -1)
|
||||||
|
ul(class='series_post_list')
|
||||||
|
- list.each(function(article){
|
||||||
|
if article.series == Series
|
||||||
|
- let link = article.link || article.path
|
||||||
|
- let title = article.title || _p('no_title')
|
||||||
|
li
|
||||||
|
a.title(href=url_for(link) title=title)= title
|
||||||
|
- })
|
||||||
|
|
||||||
@ -13,6 +13,8 @@
|
|||||||
.sticky_layout
|
.sticky_layout
|
||||||
if showToc
|
if showToc
|
||||||
include ./card_post_toc.pug
|
include ./card_post_toc.pug
|
||||||
|
if Series
|
||||||
|
include ./card_series_post.pug
|
||||||
!=partial('includes/widget/card_recent_post', {}, {cache: true})
|
!=partial('includes/widget/card_recent_post', {}, {cache: true})
|
||||||
!=partial('includes/widget/card_ad', {}, {cache: true})
|
!=partial('includes/widget/card_ad', {}, {cache: true})
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user