mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-11 16:17:25 +02:00
Do not set html lang attribute if there is no language set (#362)
* Do not set html lang attribute if there is no language set * Prettier fixes
This commit is contained in:
parent
5a77f186b9
commit
b0f26db3e1
1 changed files with 12 additions and 1 deletions
|
@ -41,8 +41,19 @@ class Site extends React.Component {
|
|||
if (fs.existsSync(CWD + '/versions.json')) {
|
||||
latestVersion = require(CWD + '/versions.json')[0];
|
||||
}
|
||||
|
||||
// We do not want a lang attribute for the html tag if we don't have a language set
|
||||
let htmlElementProps;
|
||||
if (this.props.language) {
|
||||
htmlElementProps = {
|
||||
lang: this.props.language,
|
||||
};
|
||||
} else {
|
||||
htmlElementProps = {};
|
||||
}
|
||||
|
||||
return (
|
||||
<html lang={this.props.language}>
|
||||
<html {...htmlElementProps}>
|
||||
<Head
|
||||
config={this.props.config}
|
||||
description={description}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue