custom categoryBar
This commit is contained in:
10
themes/butterfly/layout/includes/categoryBar.pug
Normal file
10
themes/butterfly/layout/includes/categoryBar.pug
Normal 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/'))= __('更多分类')
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user