Created
January 19, 2017 17:41
-
-
Save IanMitchell/f0963067da9eb85f292cd0a86e012474 to your computer and use it in GitHub Desktop.
Custom Script Tags using Next.js
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
import Document, { Head, Main, NextScript } from 'next/document' | |
export default class CustomDocument extends Document { | |
static async getInitialProps (ctx) { | |
return await Document.getInitialProps(ctx) | |
} | |
render () { | |
return ( | |
<html> | |
<Head> | |
<title>Site Title</title> | |
<link href="/static/stylesheets/styles.css" rel="stylesheet" /> | |
<link href="/static/stylesheets/prism.css" rel="stylesheet" /> | |
</Head> | |
<body> | |
<Main /> | |
<NextScript /> | |
<script src="/static/scripts/prism.js"></script> | |
</body> | |
</html> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Do you have load JQuery before your script?!