-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add <doctype HTML> to HTML pages (#566)
* Add doctype to static rendering * Set content-type for CSS
- Loading branch information
Showing
3 changed files
with
43 additions
and
23 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
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,21 @@ | ||
/** | ||
* Copyright (c) 2017-present, Facebook, Inc. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
const renderToStaticMarkup = require('react-dom/server').renderToStaticMarkup; | ||
|
||
/** | ||
* Custom function that wraps renderToStaticMarkup so that we can inject | ||
* doctype before React renders the contents. All instance of full-page | ||
* rendering within Docusaurus should use this function instead. | ||
*/ | ||
function renderToStaticMarkupWithDoctype(...args) { | ||
return '<!DOCTYPE html>' + renderToStaticMarkup(...args); | ||
} | ||
|
||
module.exports = { | ||
renderToStaticMarkupWithDoctype, | ||
}; |
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