Skip to content

Commit

Permalink
Do not set html lang attribute if there is no language set (#362)
Browse files Browse the repository at this point in the history
* Do not set html lang attribute if there is no language set

* Prettier fixes
  • Loading branch information
JoelMarcey authored Dec 27, 2017
1 parent 5a77f18 commit b0f26db
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/core/Site.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit b0f26db

Please sign in to comment.