Skip to content

[Docs] confusing gatsby-config.js #11957

@CHEWX

Description

@CHEWX

Hi,

New to Gatsby and I've noticed that there is no clear link back to gatsby-config.js.

For example if you were to setup a new site and then complete the quick tutorial. You'd then like to finish off with adding Google Analytics.

You search gatsby analytics and get taken to this page — https://github.com/gatsbyjs/gatsby/blob/master/docs/docs/adding-analytics.md

It's not obvious what gatsby-config.js is? Should there be a link back to the docs on this?

Also, the example of Google Analytics. Most people would just copy and paste that into their gatsby-config.js file, however, shouldn't it display like this:

module.exports = {
  plugins: [
    {
      resolve: 'gatsby-plugin-google-analytics',
      options: {
        // replace "UA-XXXXXXXXX-X" with your own Tracking ID
        trackingId: "UA-XXXXXXXXX-X",
      },
    },
  ],
};

This gives a little context.

Might be overly simplifying, just initial feedback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueIssue that doesn't require previous experience with Gatsbyhelp wantedIssue with a clear description that the community can help with.stale?Issue that may be closed soon due to the original author not responding any more.type: documentationAn issue or pull request for improving or updating Gatsby's documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions