mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-12 00:27:21 +02:00
Run Prettier
This commit is contained in:
parent
a7b5148e06
commit
fbae29b0ff
29 changed files with 1311 additions and 987 deletions
|
@ -7,10 +7,10 @@
|
|||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
*/
|
||||
|
||||
const React = require('react');
|
||||
const HeaderNav = require('./nav/HeaderNav.js');
|
||||
const Head = require('./Head.js');
|
||||
const Footer = require(process.cwd() + '/core/Footer.js');
|
||||
const React = require("react");
|
||||
const HeaderNav = require("./nav/HeaderNav.js");
|
||||
const Head = require("./Head.js");
|
||||
const Footer = require(process.cwd() + "/core/Footer.js");
|
||||
|
||||
class Site extends React.Component {
|
||||
/*
|
||||
|
@ -48,18 +48,26 @@ class Site extends React.Component {
|
|||
*/
|
||||
|
||||
render() {
|
||||
const tagline = this.props.config[this.props.language] ? this.props.config[this.props.language]["localized-strings"].tagline : this.props.config.tagline;
|
||||
const tagline = this.props.config[this.props.language]
|
||||
? this.props.config[this.props.language]["localized-strings"].tagline
|
||||
: this.props.config.tagline;
|
||||
const title = this.props.title
|
||||
? this.props.title + ' · ' + this.props.config.title
|
||||
: this.props.config.title + ' · ' + tagline;
|
||||
const description =
|
||||
this.props.description || tagline;
|
||||
? this.props.title + " · " + this.props.config.title
|
||||
: this.props.config.title + " · " + tagline;
|
||||
const description = this.props.description || tagline;
|
||||
const url =
|
||||
this.props.config.url + this.props.config.baseUrl + (this.props.url || 'index.html');
|
||||
this.props.config.url +
|
||||
this.props.config.baseUrl +
|
||||
(this.props.url || "index.html");
|
||||
|
||||
return (
|
||||
<html>
|
||||
<Head config={this.props.config} description={description} title={title} url={url} />
|
||||
<Head
|
||||
config={this.props.config}
|
||||
description={description}
|
||||
title={title}
|
||||
url={url}
|
||||
/>
|
||||
<body className={this.props.className}>
|
||||
<HeaderNav
|
||||
config={this.props.config}
|
||||
|
@ -76,36 +84,41 @@ class Site extends React.Component {
|
|||
<script
|
||||
type="text/javascript"
|
||||
src="//cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"
|
||||
/>
|
||||
}
|
||||
/>}
|
||||
{this.props.config.gaTrackingId &&
|
||||
<script
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `
|
||||
__html:
|
||||
`
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||||
|
||||
ga('create', '` + this.props.config.gaTrackingId + `', 'auto');
|
||||
ga('create', '` +
|
||||
this.props.config.gaTrackingId +
|
||||
`', 'auto');
|
||||
ga('send', 'pageview');
|
||||
`,
|
||||
`
|
||||
}}
|
||||
/>
|
||||
}
|
||||
/>}
|
||||
{this.props.config.algolia &&
|
||||
<script
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: `
|
||||
__html:
|
||||
`
|
||||
var search = docsearch({
|
||||
apiKey: '` + this.props.config.algolia.apiKey + `',
|
||||
indexName: '` + this.props.config.algolia.indexName + `',
|
||||
apiKey: '` +
|
||||
this.props.config.algolia.apiKey +
|
||||
`',
|
||||
indexName: '` +
|
||||
this.props.config.algolia.indexName +
|
||||
`',
|
||||
inputSelector: '#search_input_react'
|
||||
});
|
||||
`,
|
||||
`
|
||||
}}
|
||||
/>
|
||||
}
|
||||
/>}
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue