custom categoryBar

This commit is contained in:
2025-08-14 16:15:18 +08:00
parent b0a4ee340b
commit 2c9440b16a
8 changed files with 114 additions and 4 deletions

View File

@@ -0,0 +1,10 @@
.category-bar-items#category-bar-items(class=is_home() ? 'home' : '')
.category-bar-item(class=is_home() ? 'select' : '', id="category-bar-home")
a(href=url_for('/'))= __('博客首页')
each item in site.categories.find({ parent: { $exists: false } }).data
.category-bar-item(class=select ? (select === item.name ? 'select' : '') : '', id=item.name)
a(href=url_for(item.path))= item.name
.category-bar-item
a(href=url_for('/archives/'))= __('文章存档')
div.category-bar-right
a.category-bar-more(href=url_for('/categories/'))= __('更多分类')

View File

@@ -2,6 +2,8 @@ mixin indexPostUI()
- const indexLayout = theme.index_layout
- const masonryLayoutClass = (indexLayout === 6 || indexLayout === 7) ? 'masonry' : ''
#recent-posts.recent-posts.nc(class=masonryLayoutClass)
#category-bar.category-bar
include ../categoryBar.pug
.recent-post-items
each article, index in page.posts.data
.recent-post-item