-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
1 parent
0d57363
commit 552ece2
Showing
6 changed files
with
69 additions
and
3 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
title: "Gatsby + JS Party = 💜" | ||
date: 2020-03-09 | ||
author: "Dustin Schau" | ||
image: "images/jsparty.png" | ||
imageTitle: JS Party + Gatsby Banner | ||
excerpt: "I recently had the pleasure of joining the JS Party podcast to talk about all things Gatsby. Check it out!" | ||
tags: | ||
- podcast | ||
- cloud | ||
--- | ||
|
||
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! | ||
|
||
Check out the below podcast for more detail on why Gatsby, why Gatsby Cloud, and our future plans for Gatsby, the product. | ||
|
||
## 🔉JS Party Podcast 🔉 | ||
|
||
<ScriptLoader src="//cdn.changelog.com/embed.js"> | ||
<React.Fragment> | ||
<audio | ||
data-theme="day" | ||
data-src="https://changelog.com/jsparty/117/embed" | ||
src="https://cdn.changelog.com/uploads/jsparty/117/js-party-117.mp3" | ||
preload="none" | ||
className="changelog-episode" | ||
controls | ||
></audio> | ||
<p> | ||
<a href="https://changelog.com/jsparty/117"> | ||
JS Party 117: Catching up with Gatsby | ||
</a>{" "} | ||
– Listen on <a href="https://changelog.com/">Changelog.com</a> | ||
</p> | ||
</React.Fragment> | ||
</ScriptLoader> | ||
|
||
[jsparty]: https://changelog.com/jsparty | ||
[cloud]: https://gatsbyjs.com/cloud/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React, { useEffect, useRef } from 'react' | ||
|
||
function ScriptLoader({ async = true, children, src }) { | ||
const ref = useRef(null) | ||
/* | ||
* On initial render, add the script tag | ||
* as a child of the wrapper div | ||
*/ | ||
useEffect(() => { | ||
if (ref.current.lastChild && ref.current.lastChild.getAttribute('src') === src) { | ||
return | ||
} | ||
const script = document.createElement('script') | ||
script.setAttribute('async', async) | ||
script.setAttribute('src', src) | ||
|
||
ref.current.appendChild(script) | ||
}, []) | ||
|
||
return ( | ||
<div ref={ref}>{children}</div> | ||
) | ||
} | ||
|
||
export default ScriptLoader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters