Skip to content

Instantly share code, notes, and snippets.

@gdhardy1
Created May 5, 2021 17:46
Show Gist options
  • Save gdhardy1/45bf03b57930b4471ec8f943a60b2c3f to your computer and use it in GitHub Desktop.
Save gdhardy1/45bf03b57930b4471ec8f943a60b2c3f to your computer and use it in GitHub Desktop.
Setting head components in gatsby
const React = require("react")
exports.onRenderBody = ({ setHeadComponents }) => {
setHeadComponents([
<link
href="https://cloud.typography.com/path/to/your/file.css"
rel="stylesheet"
type="text/css"
media="print"
onload="this.media='all'"
referrerpolicy="origin"
/>,
])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment