mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-12 22:17:06 +08:00
first commit
This commit is contained in:
12
layout/includes/mixins/article-sort.pug
Normal file
12
layout/includes/mixins/article-sort.pug
Normal file
@@ -0,0 +1,12 @@
|
||||
mixin articleSort(posts)
|
||||
.article-sort
|
||||
- var year
|
||||
- posts.each(function (article) {
|
||||
- var tempYear = date(article.date, 'YYYY')
|
||||
if tempYear !== year
|
||||
- year = tempYear
|
||||
.article-sort-item.year= year
|
||||
.article-sort-item
|
||||
time.article-sort-item__time= date(article.date)
|
||||
a.article-sort-item__title(href=url_for(article.path))= article.title || 'No Title'
|
||||
- })
|
||||
Reference in New Issue
Block a user