menu

Gatsby.js

Fast in every way that matters. Gatsby is a free and open source framework based on React that helps developers build blazing fast websites and apps.

Channels
# All channels
view-forward
# General
view-forward
# I Made This
view-forward
# Meta
view-forward
# Themes
view-forward
Team

gatsby-remark-images stored outside of the markdown file folder not being…

February 15, 2018 at 5:45pm

gatsby-remark-images stored outside of the markdown file folder not being processed

February 15, 2018 at 5:45pm
Hello
I was wondering if anyone has had any experience with getting gatsby-remark-images to work with images referenced outside of the folder the markdown post is in?
I have attached the image below to highlight my setup and highlight what is converting and what isn't
I haven't been able to find anything that says this isn't possible but at the same time, it doesn't say if it is. Any help would be greatly appreciated.

February 15, 2018 at 5:55pm
Referencing files anywhere is supported as long as the referenced files are covered by your gatsby-source-filesystem config.
like-fill
1
  • reply
  • like
Thank you for getting back so quickly. I have this in my config https://github.com/tbrasington/tbrasington-gatsby/blob/develop/gatsby-config.js Is this incorrectly configured?
  • reply
  • like

February 16, 2018 at 12:35pm
keep you images in the src/img folder as per your config and use ../../img/cat.jpg depending how many folders deep your markdown folder is relative to that directory
  • reply
  • like
or create a folder inside the img directory to organise images such as img/blog then use ../../img/blog/cat.jpg
  • reply
  • like
Aye realised that will fix that. Its the challenge with netflifycms and the way it currently injects images. Thank you for the help though!
  • reply
  • like
i think you can specify an image directory outside of the static directory in netlify cms
  • reply
  • like
There is a fork of netlifycms https://github.com/fk/netlify-cms/commit/2ebbed8e86b17dce4fa8a9dfd8822275d73361d1 that will allow relative paths, which in turn lets gatsby-remark-images play together
  • reply
  • like

September 13, 2018 at 7:33pm
Referencing files anywhere is supported as long as the referenced files are covered by your gatsby-source-filesystem config.
Hi Kyle, can you explain how I would configure gatsby-source-filesystem to be aware of a folder of images in /static/images/uploads? Sorry if it's obvious...
  • reply
  • like