Skip to content

Commit 207f059

Browse files
authored
Merge pull request #1987 from hpe-dev-incubator/#1880-New-External-blog-links
#1880-New-External-blog-links
2 parents 50573a6 + d0bf5d4 commit 207f059

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

gatsby-node.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,8 @@ exports.createPages = async ({ graphql, actions }) => {
258258
}
259259
}
260260
}
261-
tagsGroup: allMarkdownRemark(limit: 2000) {
261+
tagsGroup: allMarkdownRemark(limit: 2000,
262+
filter:{frontmatter:{disable:{ne:true}}}) {
262263
group(field: frontmatter___tags) {
263264
fieldValue
264265
}

src/components/BlogCard/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const BlogCard = ({ node, ...rest }) => {
4949
console.log('external open link window');
5050
window.open(
5151
`${
52-
node?.externalLink
52+
node?.externalLink != null
5353
? node?.externalLink
5454
: node?.frontmatter?.externalLink
5555
}`,

src/pages/tags/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ export const pageQuery = graphql`
8585
title
8686
}
8787
}
88-
allMarkdownRemark(limit: 2000) {
88+
allMarkdownRemark(
89+
limit: 2000
90+
filter: { frontmatter: { disable: { ne: true } } }
91+
) {
8992
group(field: frontmatter___tags) {
9093
fieldValue
9194
totalCount

src/templates/blog-post.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ function BlogPostTemplate({ data }) {
162162
<SectionHeader title="Related" color="border">
163163
<ResponsiveGrid gap="large" rows={rows} columns={columns}>
164164
{blogsByTags.map((blogPost) =>
165-
blogPost.url !== '/' &&
166-
(blogPost.node.frontmatter.authorimage ||
167-
blogPost.node.frontmatter.author) ? (
165+
(blogPost.url !== '/' &&
166+
blogPost.node.frontmatter.authorimage) ||
167+
blogPost.node.frontmatter.author ? (
168168
<BlogCard key={blogPost.node.id} node={blogPost.node} />
169169
) : undefined,
170170
)}
@@ -278,6 +278,7 @@ export const pageQuery = graphql`
278278
tags
279279
authorimage
280280
thumbnailimage
281+
externalLink
281282
}
282283
rawMarkdownBody
283284
}

src/templates/tags.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ export const pageQuery = graphql`
126126
title
127127
author
128128
date
129+
externalLink
129130
authorimage
130131
}
131132
excerpt

0 commit comments

Comments
 (0)