From ff2546e3f920aea9423a5cc45f2f002df43a7e2b Mon Sep 17 00:00:00 2001 From: Ebonie Date: Mon, 15 Mar 2021 22:16:03 -0400 Subject: [PATCH] =?UTF-8?q?Update=20Blog=20=E2=80=9Ctest-page=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- content/blog/test-page.md | 42 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 content/blog/test-page.md diff --git a/content/blog/test-page.md b/content/blog/test-page.md new file mode 100644 index 0000000..da7bc9f --- /dev/null +++ b/content/blog/test-page.md @@ -0,0 +1,42 @@ +--- +path: awesome-images-test +date: 2021-03-15T15:50:39.880Z +title: Test Page +description: Fix for gatsby-plugin-mdx and gatsby-remark-images +--- +Ebonie Butler + +![Great Gatsby](/../assets/great2.jpg "Great Gatsby") + +## Netlify CMS Media Configuration + +First, in your `static/admin/config.yml`, make sure you have the following: + +``` +media_folder: content/assets +public_folder: ../assets +``` + +Docs: https://www.netlifycms.org/docs/configuration-options/#media-and-public-folders. + +## Gatsby Plugins + +From [@cwgw](https://github.com/cwgw): + +So digging a little deeper, it looks like Gatsby only looks for "subplugins" at one specific path, `options.plugins`. + +`gatsby-plugin-mdx` uses `options.gatsbyRemarkPlugins`. This is fine for transforming markdown as the plugin handles that itself, but Gatsby-specific api files like `gatsby-browser.js` don't get loaded because Gatsby doesn't know they exist. Hi! + +If you try this… + +```javascript +{ + resolve: 'gatsby-plugin-mdx', + options: { + gatsbyRemarkPlugins: [ `gatsby-remark-images` ], + plugins: [ `gatsby-remark-images` ], + } +}, +``` + +…everything works as it should. \ No newline at end of file