Skip to content

Commit 5669871

Browse files
committed
external blog links fixed-2
1 parent 82ff3f8 commit 5669871

File tree

7 files changed

+34
-29
lines changed

7 files changed

+34
-29
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/components/Header/index.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,16 @@ function Header() {
4141
/* const leftColumn = greenlake.filter((gl, index) => index % 2 === 0); */
4242
const leftColumn = greenlake;
4343
const rightColumn = greenlake.filter((gl, index) => index % 2);
44-
const externalLinks = [
45-
{
46-
title: 'HPE GreenLake API Portal',
47-
slug: 'https://developer.greenlake.hpe.com/',
48-
},
49-
{
50-
title: 'HPE GreenLake Test Drive',
51-
slug: 'https://testdrive.greenlake.hpe.com/',
52-
},
53-
];
44+
// const externalLinks = [
45+
// {
46+
// title: 'HPE GreenLake API Portal',
47+
// slug: 'https://developer.greenlake.hpe.com/',
48+
// },
49+
// {
50+
// title: 'HPE GreenLake Test Drive',
51+
// slug: 'https://testdrive.greenlake.hpe.com/',
52+
// },
53+
// ];
5454

5555
// const externalLeftColumn = externalLinks.filter(
5656
// (el, index) => index % 2 === 0,
@@ -75,18 +75,18 @@ function Header() {
7575
);
7676
});
7777

78-
// const elColumns = externalLinksColumn.map((el, index) => {
79-
// const { slug, title } = el;
80-
// return (
81-
// <ExternalButtonLink
82-
// key={index}
83-
// label={title}
84-
// to={`${slug}`}
85-
// alignSelf="start"
86-
// fill="horizontal"
87-
// />
88-
// );
89-
// });
78+
// const elColumns = externalLinksColumn.map((el, index) => {
79+
// const { slug, title } = el;
80+
// return (
81+
// <ExternalButtonLink
82+
// key={index}
83+
// label={title}
84+
// to={`${slug}`}
85+
// alignSelf="start"
86+
// fill="horizontal"
87+
// />
88+
// );
89+
// });
9090
const allLinks = [/* ...elColumns, */ ...glColumns];
9191
return allLinks;
9292
};

src/pages/slack-signup/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ export default function Slacksignup() {
175175
borderRadius: '100px',
176176
color: '#ffffff',
177177
width: '250px',
178-
position: 'relative',
178+
position: 'relative',
179179
height: '40px',
180180
}}
181181
/>

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: 3 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
)}

src/templates/tags.js

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

0 commit comments

Comments
 (0)