Skip to content

Commit 552ece2

Browse files
DSchaugatsbybothashimwarren
authoredMar 10, 2020
blog: add jsparty + gatsby post (#22024)
* blog: add jsparty + gatsby post * feat: add a scriptloader commponent; update blog post * feat: add scriptloader to global mdx shortcodes Note: this was the only way I could get this working, I wanted to import, but was getting weird errors with "hooks warnings." * Add comma for clarity Co-authored-by: gatsbybot <mathews.kyle+gatsbybot@gmail.com> Co-authored-by: Hashim Warren <hashimwarren@gmail.com>
1 parent 0d57363 commit 552ece2

File tree

6 files changed

+69
-3
lines changed

6 files changed

+69
-3
lines changed
 
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: "Gatsby + JS Party = 💜"
3+
date: 2020-03-09
4+
author: "Dustin Schau"
5+
image: "images/jsparty.png"
6+
imageTitle: JS Party + Gatsby Banner
7+
excerpt: "I recently had the pleasure of joining the JS Party podcast to talk about all things Gatsby. Check it out!"
8+
tags:
9+
- podcast
10+
- cloud
11+
---
12+
13+
Recently I had the pleasure of joining the [JSParty][jsparty] podcast to discuss _all_ things Gatsby. Starting with the classic question of "What is Gatsby?", progressing to the value of rehydration, future deliverables of the open-source product, [Gatsby Cloud][cloud], and everything in between! Quite simply, all things Gatsby with the JS Party crew!
14+
15+
Check out the below podcast for more detail on why Gatsby, why Gatsby Cloud, and our future plans for Gatsby, the product.
16+
17+
## 🔉JS Party Podcast 🔉
18+
19+
<ScriptLoader src="//cdn.changelog.com/embed.js">
20+
<React.Fragment>
21+
<audio
22+
data-theme="day"
23+
data-src="https://changelog.com/jsparty/117/embed"
24+
src="https://cdn.changelog.com/uploads/jsparty/117/js-party-117.mp3"
25+
preload="none"
26+
className="changelog-episode"
27+
controls
28+
></audio>
29+
<p>
30+
<a href="https://changelog.com/jsparty/117">
31+
JS Party 117: Catching up with Gatsby
32+
</a>{" "}
33+
– Listen on <a href="https://changelog.com/">Changelog.com</a>
34+
</p>
35+
</React.Fragment>
36+
</ScriptLoader>
37+
38+
[jsparty]: https://changelog.com/jsparty
39+
[cloud]: https://gatsbyjs.com/cloud/

‎docs/blog/author.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
avatar: avatars/kyle-mathews.jpeg
44
twitter: "@kylemathews"
55
- id: Dustin Schau
6-
bio: Software Engineer @ GatsbyJS. Likes all things JavaScript, and travel. Doesn't totally suck 👋
6+
bio: Head of Product @ GatsbyJS. Likes all things JavaScript, and travel. Doesn't totally suck 👋
77
avatar: avatars/dustin-schau.png
88
twitter: "@schaudustin"
99
- id: Kostas Bariotis

‎www/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@
8181
"qs": "^6.9.1",
8282
"query-string": "^6.9.0",
8383
"range": "^0.0.3",
84-
"react": "^16.12.0",
84+
"react": "^16.13.0",
8585
"react-copy-to-clipboard": "^5.0.2",
86-
"react-dom": "^16.12.0",
86+
"react-dom": "^16.13.0",
8787
"react-helmet": "^5.2.1",
8888
"react-highcharts": "^16.1.0",
8989
"react-icons": "^3.9.0",

‎www/src/components/script-loader.js

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import React, { useEffect, useRef } from 'react'
2+
3+
function ScriptLoader({ async = true, children, src }) {
4+
const ref = useRef(null)
5+
/*
6+
* On initial render, add the script tag
7+
* as a child of the wrapper div
8+
*/
9+
useEffect(() => {
10+
if (ref.current.lastChild && ref.current.lastChild.getAttribute('src') === src) {
11+
return
12+
}
13+
const script = document.createElement('script')
14+
script.setAttribute('async', async)
15+
script.setAttribute('src', src)
16+
17+
ref.current.appendChild(script)
18+
}, [])
19+
20+
return (
21+
<div ref={ref}>{children}</div>
22+
)
23+
}
24+
25+
export default ScriptLoader

‎www/src/gatsby-plugin-theme-ui/components.js

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import VisuallyHidden from "../components/visually-hidden"
1515
import Events from "../components/events/events"
1616
import StubList from "../components/stub-list"
1717
import LangList from "../components/lang-list"
18+
import ScriptLoader from "../components/script-loader"
1819

1920
export default {
2021
GuideList,
@@ -30,6 +31,7 @@ export default {
3031
Events,
3132
StubList,
3233
LangList,
34+
ScriptLoader,
3335
a: MdxLink,
3436
pre: ({ children }) => <CodeBlock>{children}</CodeBlock>,
3537
}

0 commit comments

Comments
 (0)
Please sign in to comment.