Skip to content
This repository was archived by the owner on Mar 23, 2021. It is now read-only.

Commit 44a673d

Browse files
committed
Add support for team descriptions
1 parent 38c8476 commit 44a673d

File tree

3 files changed

+26
-1
lines changed

3 files changed

+26
-1
lines changed

gatsby-node.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ exports.createPages = async ({ graphql, actions }) => {
9292
template = showsTemplate;
9393
} else if (
9494
node.slug !== `hash-article` &&
95+
node.slug !== `hash-description` &&
9596
node.slug !== `hash-podcast` &&
9697
!node.slug.endsWith("star") &&
9798
!node.slug.endsWith("stars") &&

src/styles/custom.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,3 +244,11 @@ body .site-footer {
244244
height: 30px;
245245
margin-top: 2vw;
246246
}
247+
.description.post-full-content {
248+
padding-top: 0px;
249+
background: transparent;
250+
}
251+
.description.post-full-content::after,
252+
.description.post-full-content::before {
253+
display: none;
254+
}

src/templates/team.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ import { MetaData } from "../components/common/meta";
1313
*/
1414
const Tag = ({ data, location, pageContext }) => {
1515
const tag = data.ghostTag;
16-
const posts = data.allGhostPost.edges;
16+
const o_posts = data.allGhostPost.edges;
17+
const posts = o_posts.filter(
18+
({ node }) => !node.tags.find(t => t.slug == "hash-description")
19+
);
20+
let description = o_posts
21+
.map(({ node }) => node)
22+
.find(p => p.tags.find(t => t.slug == "hash-description"));
1723

1824
return (
1925
<>
@@ -24,6 +30,16 @@ const Tag = ({ data, location, pageContext }) => {
2430
<h1>{tag.name.slice(1)}</h1>
2531
{tag.description ? <p>{tag.description}</p> : null}
2632
</header>
33+
{description && (
34+
<section className="post-full-content description">
35+
<div
36+
className="post-content load-external-scripts"
37+
dangerouslySetInnerHTML={{
38+
__html: description.html
39+
}}
40+
/>
41+
</section>
42+
)}
2743
<section className="post-feed">
2844
{posts.map(({ node }) => (
2945
// The tag below includes the markup for each post - components/common/PostCard.js

0 commit comments

Comments
 (0)