diff --git a/packages/gatsby-theme-blog-core/README.md b/packages/gatsby-theme-blog-core/README.md index b1c3c9f720376..3cd3ff4d8f7aa 100644 --- a/packages/gatsby-theme-blog-core/README.md +++ b/packages/gatsby-theme-blog-core/README.md @@ -54,12 +54,12 @@ module.exports = { ### Theme options -| Key | Default value | Description | -| ------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `basePath` | `/` | Root url for all blog posts | -| `contentPath` | `content/posts` | Location of blog posts | -| `assetPath` | `content/assets` | Location of assets | -| `mdx` | `true` | Configure `gatsby-plugin-mdx`. Note that most sites will not need to use this flag. If your site has already configured `gatsby-plugin-mdx` separately, set this flag `false`. | +| Key | Default value | Description | +| ------------------------ | ---------------- | -------------------------------------------------------------------------------- | +| `basePath` | `/` | Root url for all blog posts | +| `contentPath` | `content/posts` | Location of blog posts | +| `assetPath` | `content/assets` | Location of assets | +| `mdxOtherwiseConfigured` | `false` | Set this flag `true` if `gatsby-plugin-mdx` is already configured for your site. | #### Example usage diff --git a/packages/gatsby-theme-blog-core/gatsby-config.js b/packages/gatsby-theme-blog-core/gatsby-config.js index 82698dad846e7..2a8d8bdd021e3 100644 --- a/packages/gatsby-theme-blog-core/gatsby-config.js +++ b/packages/gatsby-theme-blog-core/gatsby-config.js @@ -2,7 +2,8 @@ const withDefaults = require(`./utils/default-options`) module.exports = themeOptions => { const options = withDefaults(themeOptions) - const { mdx = true } = themeOptions + let { mdxOtherwiseConfigured = false, mdx: legacyConfigureMdxFlag = true } = themeOptions // keep mdx flag so we don't introduce a breaking change + return { siteMetadata: { title: `Blog Title Placeholder`, @@ -20,7 +21,7 @@ module.exports = themeOptions => { ], }, plugins: [ - mdx && { + (!mdxOtherwiseConfigured && legacyConfigureMdxFlag) && { resolve: `gatsby-plugin-mdx`, options: { extensions: [`.mdx`, `.md`], diff --git a/packages/gatsby-theme-blog/README.md b/packages/gatsby-theme-blog/README.md index b6b519ca40e37..934f2c77df823 100644 --- a/packages/gatsby-theme-blog/README.md +++ b/packages/gatsby-theme-blog/README.md @@ -56,12 +56,12 @@ module.exports = { ### Theme options -| Key | Default value | Description | -| ------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `basePath` | `/` | Root url for all blog posts | -| `contentPath` | `content/posts` | Location of blog posts | -| `assetPath` | `content/assets` | Location of assets | -| `mdx` | `true` | Configure `gatsby-plugin-mdx`. Note that most sites will not need to use this flag. If your site has already configured `gatsby-plugin-mdx` separately, set this flag `false`. | +| Key | Default value | Description | +| ------------------------ | ---------------- | -------------------------------------------------------------------------------- | +| `basePath` | `/` | Root url for all blog posts | +| `contentPath` | `content/posts` | Location of blog posts | +| `assetPath` | `content/assets` | Location of assets | +| `mdxOtherwiseConfigured` | `false` | Set this flag `true` if `gatsby-plugin-mdx` is already configured for your site. | #### Example configuration diff --git a/packages/gatsby-theme-notes/README.md b/packages/gatsby-theme-notes/README.md index ab5cf5a0c7247..83b14d76fe621 100644 --- a/packages/gatsby-theme-notes/README.md +++ b/packages/gatsby-theme-notes/README.md @@ -45,14 +45,17 @@ module.exports = { ``` 3. Add notes to your site by creating `md` or `mdx` files inside `/content/notes`. + > Note that if you've changed the default `contentPath` in the configuration, you'll want to add your markdown files in the directory specified by that path. +4. Run your site using `gatsby develop` and navigate to your notes. If you used the above configuration, your URL will be `http://localhost:8000/notes` + ### Options -| Key | Default value | Description | -| --------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `basePath` | `/` | Root url for all notes pages | -| `contentPath` | `/content/notes` | Location of notes content | -| `mdx` | `true` | Configure `gatsby-plugin-mdx`. Note that most sites will not need to use this flag. If your site has already configured `gatsby-plugin-mdx` separately, set this flag `false`. | -| `homeText` | `~` | Root text for notes breadcrumb trail | -| `breadcrumbSeparator` | `/` | Separator for the breadcrumb trail | +| Key | Default value | Description | +| ------------------------ | ---------------- | -------------------------------------------------------------------------------- | +| `basePath` | `/` | Root url for all notes pages | +| `contentPath` | `/content/notes` | Location of notes content | +| `mdxOtherwiseConfigured` | `false` | Set this flag `true` if `gatsby-plugin-mdx` is already configured for your site. | +| `homeText` | `~` | Root text for notes breadcrumb trail | +| `breadcrumbSeparator` | `/` | Separator for the breadcrumb trail | diff --git a/packages/gatsby-theme-notes/gatsby-config.js b/packages/gatsby-theme-notes/gatsby-config.js index 0b921ceb26955..52e03a4b54e99 100644 --- a/packages/gatsby-theme-notes/gatsby-config.js +++ b/packages/gatsby-theme-notes/gatsby-config.js @@ -1,5 +1,5 @@ module.exports = options => { - const { mdx = true, mdxLayouts = {} } = options + const { mdxOtherwiseConfigured = false, mdx: legacyConfigureMdxFlag = true, mdxLayouts = {} } = options return { siteMetadata: { @@ -8,7 +8,7 @@ module.exports = options => { siteUrl: `http://example.com/`, }, plugins: [ - mdx && { + (!mdxOtherwiseConfigured && legacyConfigureMdxFlag) && { resolve: `gatsby-plugin-mdx`, options: { extensions: [`.md`, `.mdx`],