File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -102,25 +102,26 @@ function BlogPostTemplate({ data }) {
102
102
authorimage,
103
103
thumbnailimage,
104
104
} = post . frontmatter ;
105
- const k = [ ] ;
105
+ const ids = [ ] ;
106
106
const node = [ ] ;
107
107
let count = 0 ;
108
108
tags ?. forEach ( ( tag ) => {
109
109
blogsByTags ?. forEach ( ( n ) => {
110
110
if (
111
111
n . node . frontmatter . tags . includes ( tag ) &&
112
112
count < 8 &&
113
- ! k . includes ( n . node . id ) &&
113
+ ! ids . includes ( n . node . id ) &&
114
+ post . id !== n . node . id &&
114
115
n . node . frontmatter . authorimage &&
115
116
n . node . frontmatter . author
116
117
) {
117
118
count += 1 ;
118
- k . push ( n . node . id ) ;
119
+ ids . push ( n . node . id ) ;
119
120
node . push ( n . node ) ;
120
121
}
121
122
} ) ;
122
123
} ) ;
123
- const blogCards = k . map ( ( item , i ) => < BlogCard key = { item } node = { node [ i ] } /> ) ;
124
+ const blogCards = ids . map ( ( item , i ) => < BlogCard key = { item } node = { node [ i ] } /> ) ;
124
125
125
126
return (
126
127
< Layout title = { siteTitle } >
@@ -280,7 +281,7 @@ export const pageQuery = graphql`
280
281
blogsByTags: allMarkdownRemark(
281
282
filter: {
282
283
fields: { sourceInstanceName: { eq: "blog" } }
283
- frontmatter: { tags: { regex: $tagRE } }
284
+ frontmatter: { tags: { regex: $tagRE }, disable: { ne: true } }
284
285
}
285
286
) {
286
287
edges {
@@ -298,6 +299,7 @@ export const pageQuery = graphql`
298
299
tags
299
300
authorimage
300
301
thumbnailimage
302
+ disable
301
303
}
302
304
rawMarkdownBody
303
305
}
You can’t perform that action at this time.
0 commit comments