I am trying to add new projects to my GatsbyJS site using Netlify CMS. The problem is that my code is using relative path to reach the thumb images but when uploading a new thumb image from netlify it saves it as an absolute path. This is causing a problem and I dont understand what it is exactly. Is Gatsby not able to read the absolute path that is being received from the CMS? If that could be the problem, how could i make that the CMS gives me a relative path?
Any help will be much appreciated :)
This is the path in my markdown files:
thumb: ../images/thumbs/memory.png
This is the path created by the CMS:
/src/images/thumbs/img_2370.jpg
This is my config.yml
backend:
name: git-gateway
branch: master # Branch to update (optional; defaults to master)
publish_mode: editorial_workflow
media_folder: "src/images/thumbs"
collections:
- name: "projects" # Used in routes, e.g., /admin/collections/blog
label: "Projects" # Used in the UI
folder: "src/projects" # The path to the folder where the documents are stored
create: true # Allow users to create new documents in this collection
slug: "{{slug}}" # Filename template, e.g., YYYY-MM-DD-title.md
fields: # The fields for each document, usually in front matter
- { label: "Title", name: "title", widget: "string" }
- { label: "Stack", name: "stack", widget: "string" }
- { label: "Slug", name: "slug", widget: "string" }
- { label: "Url", name: "url", widget: "string" }
- { label: "Publish Date", name: "date", widget: "datetime" }
- { label: "Thumb", name: "thumb", widget: "image" }
- { label: "Body", name: "body", widget: "markdown" }
testing images in the static folder
", "frontmatter": { "title": "testing images in static folderr", "stack": "react", "slug": "static-folder", Creating deploy upload records "url": "simonc.netlify.app", "thumb": null }, "id": "94da2cfa-4a31-5548-80e2-896e64ce8434" }, – Simon CF May 31 '22 at 18:11