Hi Everyone, so I am creating a little portfolio project with Gatsby Js and Netlify CMS. I think my problem is related to relative / absolute paths…
simonc.netlify.app
When I create a MD file manually to reach the “thumb” I use the path for example like this:
thumb: …/…/static/assets/images/countries.png
But when I create a new “project” from the CMS And I check the thumb path that is uploaded to GitHub it looks like this:
/assets/images/e3efdb08-88e0-482a-a2e9-9f217dc5a7bb.jpeg
Then when netlify tries to deploy the site with the new CMS created project it fails cause it cannot find the thumb anywhere. How can I do to have same style of paths everywhere in my project? Can and should I change the MD files? Or is it maybe something in the config.yml?
I am new to gatsby and CMSs so any help will be appreciated
Thanks, Simon!
backend:
name: git-gateway
branch: master # Branch to update (optional; defaults to master)
publish_mode: editorial_workflow
# media_folder: "src/images/thumbs"
media_folder: "static/assets/images" # Media files will be stored in the repo under static/images/uploads
public_folder: "/assets/images" # The src attribute for uploaded media will begin with /images/uploads
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" }