forked from Chalarangelo/30-seconds-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix XMLs injected with data-react-helmet
Fixes Chalarangelo#162
- Loading branch information
1 parent
2e43bf8
commit 444988b
Showing
2 changed files
with
29 additions
and
12 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,4 +1,32 @@ | ||
/* | ||
Gatsby SSR API | ||
*/ | ||
export { default as wrapRootElement } from 'state/ReduxWrapper'; | ||
import ReduxWrapper from 'state/ReduxWrapper'; | ||
import React from 'react'; | ||
|
||
/** | ||
* Wraps the whole application in a redux Provider. | ||
*/ | ||
export const wrapRootElement = ReduxWrapper; | ||
|
||
/** | ||
* Called after rendering a page. Injects sitemap and opensearch XMLs. | ||
* TODO: Improve and extract outside of this file, if/when possible. | ||
*/ | ||
export const onRenderBody = ({ setHeadComponents }) => { | ||
setHeadComponents([ | ||
<link | ||
key="link-sitemap" | ||
rel="sitemap" | ||
href="/sitemap.xml" | ||
type="application/xml" | ||
/>, | ||
<link | ||
key="link-opensearch" | ||
rel="search" | ||
href="/opensearch.xml" | ||
type="application/opensearchdescription+xml" | ||
title="Snippet search" | ||
/>, | ||
]); | ||
}; |
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