Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add generator meta tag for gatsby version #8221

Merged
merged 10 commits into from
Sep 17, 2018
2 changes: 2 additions & 0 deletions packages/gatsby/cache-dir/default-html.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default class HTML extends React.Component {
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
{this.props.gatsbyVersion && <meta name="generator" content={`Gatsby ${this.props.gatsbyVersion}`} />}
{this.props.headComponents}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of adding it to the default html component (which is often overrided), set it as a component in headComponents

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was so close to doing it this way instead 🙃 Will do it that way, one sec

</head>
<body {...this.props.bodyAttributes}>
Expand All @@ -32,6 +33,7 @@ HTML.propTypes = {
htmlAttributes: PropTypes.object,
headComponents: PropTypes.array,
bodyAttributes: PropTypes.object,
gatsbyVersion: PropTypes.string,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs removed

Copy link
Contributor Author

@DSchau DSchau Sep 17, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! (and done)

preBodyComponents: PropTypes.array,
body: PropTypes.string,
postBodyComponents: PropTypes.array,
Expand Down
2 changes: 2 additions & 0 deletions packages/gatsby/cache-dir/static-entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const { get, merge, isObject, flatten, uniqBy } = require(`lodash`)
const apiRunner = require(`./api-runner-ssr`)
const syncRequires = require(`./sync-requires`)
const { dataPaths, pages } = require(`./data.json`)
const { version: gatsbyVersion } = require(`gatsby/package.json`)

// Speed up looking up pages.
const pagesObjectMap = new Map()
Expand Down Expand Up @@ -371,6 +372,7 @@ export default (pagePath, callback) => {
headComponents={headComponents}
htmlAttributes={htmlAttributes}
bodyAttributes={bodyAttributes}
gatsbyVersion={gatsbyVersion}
preBodyComponents={preBodyComponents}
postBodyComponents={postBodyComponents}
body={bodyHtml}
Expand Down