mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-24 05:28:01 +02:00
[markdown] Switch to Remarkable (#153)
* Switch to Remarkable * Clean up references to custom code blocks * Remove valdiateDOMNesting warning * Add syntax highlighting * Add Reason support * Breaking change: prismColor to codeColor, remove CompLibrary.Prism, expose hljs * Completely remove Prism and associated CSS rules * Support loading plugins and scripts * Remove CSS rules, allowing Highlight.js theme to be used entirely * Remove unnecessary webplayer script
This commit is contained in:
parent
58613545b6
commit
b832176dc6
18 changed files with 231 additions and 2744 deletions
|
@ -10,15 +10,24 @@ const React = require("react");
|
|||
// html head for each page
|
||||
class Head extends React.Component {
|
||||
render() {
|
||||
let links = this.props.config.headerLinks;
|
||||
const links = this.props.config.headerLinks;
|
||||
let hasBlog = false;
|
||||
links.map(link => {
|
||||
if (link.blog) hasBlog = true;
|
||||
});
|
||||
let sourceCodeButton = this.props.config.sourceCodeButton;
|
||||
// defaults to github, but other values may be allowed in the future
|
||||
let includeGithubButton =
|
||||
const sourceCodeButton = this.props.config.sourceCodeButton;
|
||||
// defaults to GitHub, but other values may be allowed in the future
|
||||
const includeGitHubButton =
|
||||
sourceCodeButton === "github" || sourceCodeButton == null;
|
||||
|
||||
const highlightDefaultVersion = '9.12.0';
|
||||
const highlightConfig = this.props.config.highlight
|
||||
|| { version: highlightDefaultVersion, theme: 'default' };
|
||||
const highlightVersion = highlightConfig.version || highlightDefaultVersion;
|
||||
const highlightTheme = highlightConfig.theme || 'default';
|
||||
|
||||
const hasCustomScripts = this.props.config.scripts;
|
||||
|
||||
return (
|
||||
<head>
|
||||
<meta charSet="utf-8" />
|
||||
|
@ -64,7 +73,7 @@ class Head extends React.Component {
|
|||
href={this.props.config.url + "/blog/atom.xml"}
|
||||
title={this.props.config.title + " Blog ATOM Feed"}
|
||||
/>
|
||||
)}{" "}
|
||||
)}
|
||||
{hasBlog && (
|
||||
<link
|
||||
rel="alternate"
|
||||
|
@ -73,14 +82,18 @@ class Head extends React.Component {
|
|||
title={this.props.config.title + " Blog RSS Feed"}
|
||||
/>
|
||||
)}
|
||||
{includeGithubButton && (
|
||||
{includeGitHubButton && (
|
||||
<script async defer src="https://buttons.github.io/buttons.js" />
|
||||
)}
|
||||
<script
|
||||
type="text/javascript"
|
||||
src={this.props.config.baseUrl + "js/webplayer.js"}
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href={`//cdnjs.cloudflare.com/ajax/libs/highlight.js/${highlightVersion}/styles/${highlightTheme}.min.css`}
|
||||
/>
|
||||
<script type="text/javascript" src="https://snack.expo.io/embed.js" />
|
||||
{hasCustomScripts && this.props.config.scripts.map(function(source) {
|
||||
return (
|
||||
<script type="text/javascript" src={source} />
|
||||
);
|
||||
})}
|
||||
</head>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue