diff --git a/client/gatsby-ssr.js b/client/gatsby-ssr.js index 91a115123c..041dda0934 100644 --- a/client/gatsby-ssr.js +++ b/client/gatsby-ssr.js @@ -4,10 +4,9 @@ import { Provider } from 'react-redux'; import { I18nextProvider } from 'react-i18next'; import i18n from './i18n/config'; -import headComponents from './src/head'; import { createStore } from './src/redux/createStore'; - import layoutSelector from './utils/gatsby/layoutSelector'; +import { getheadTagComponents, getPostBodyComponents } from './utils/tags'; const store = createStore(); @@ -23,26 +22,6 @@ wrapRootElement.propTypes = { element: PropTypes.any }; -// TODO: put these in a common utils file. -const mathJaxCdn = { - address: - 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/' + - '2.7.4/MathJax.js?config=TeX-AMS_HTML', - id: 'mathjax', - key: 'mathjax', - type: 'text/javascript' -}; - -const stripeScript = { - address: 'https://js.stripe.com/v3/', - id: 'stripe-js', - key: 'stripe-js', - type: 'text/javascript' -}; - -const challengeRE = new RegExp('/learn/[^/]+/[^/]+/[^/]+/?$'); -const donateRE = new RegExp('/donate/?$'); - export const wrapPageElement = layoutSelector; export const onRenderBody = ({ @@ -50,52 +29,6 @@ export const onRenderBody = ({ setHeadComponents, setPostBodyComponents }) => { - setHeadComponents([...headComponents]); - const scripts = [ -