File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ export default {
5454 // 根据分类获取页面数据
5555 getPages (tag ) {
5656 let pages = this .$site .pages
57- pages = this ._filterPostData (pages)
57+ pages = this ._filterPostData (pages, true )
5858 // reverse()是为了按时间最近排序排序
5959 this .pages = pages .length == 0 ? [] : pages
6060 for (let i = 0 , length = pages .length ; i < length; i++ ) {
Original file line number Diff line number Diff line change @@ -6,10 +6,12 @@ export default {
66 const index = Math . floor ( Math . random ( ) * tagColorArr . length )
77 return tagColorArr [ index ]
88 } ,
9- _filterPostData ( posts ) {
9+ _filterPostData ( posts , isTimeline ) {
1010 posts = posts . filter ( item => {
1111 const { home, date, publish } = item . frontmatter
12- return ! ( home == true || date === undefined || publish === false )
12+ return isTimeline === true
13+ ? ! ( home == true || date === undefined || publish === false )
14+ : ! ( home == true || publish === false )
1315 } )
1416 return posts
1517 } ,
@@ -23,4 +25,4 @@ export default {
2325 return parseInt ( new Date ( date . frontmatter . date ) . getTime ( ) )
2426 }
2527 }
26- }
28+ }
You can’t perform that action at this time.
0 commit comments