Giter Club home page Giter Club logo

Comments (5)

davidvasandani avatar davidvasandani commented on May 6, 2024 1

@ced64k this resolved the issue for me and here is the plugin discussion adding support to relative paths.

from eleventy-netlify-boilerplate.

danurbanowicz avatar danurbanowicz commented on May 6, 2024

Hi, can post the contents of your config.yml so we can take a look?

Also, if you haven't already, take a look at the docs concerning Media and Public Folders and the Image Widget.

from eleventy-netlify-boilerplate.

ced64k avatar ced64k commented on May 6, 2024

@danurbanowicz it's only the default config.yml from this repository with the line "path" added:


# The backend option specifies how to access the content for your site
backend:
  name: git-gateway
  branch: master # The branch to update (optional; defaults to master)

# Uncomment below to enable drafts https://www.netlifycms.org/docs/add-to-your-site/#editorial-workflow
# publish_mode: editorial_workflow

# Uncomment below to enable a link to your published site in the header bar of Netlify CMS
# site_url: https://eleventy-netlify-boilerplate.netlify.app/

media_folder: "static/img" # Media files will be stored in the repo under images/uploads

collections:
  # Our blog posts
  - name: "blog" # Used in routes, e.g., /admin/collections/blog
    label: "Post" # Used in the UI
    folder: "posts" # 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
    path: "{{year}}/{{month}}/{{month}}/{{slug}}/index"
    fields: # The fields for each document, usually in front matter
      - { label: "Title", name: "title", widget: "string" }
      - { label: "Publish Date", name: "date", widget: "datetime" }
      - { label: "Author", name: "author", widget: "string", default: "Anonymous" }
      - { label: "Summary", name: "summary", widget: "text" }
      - { label: "Tags", name: "tags", widget: "list", default: ["post"] }
      - { label: "Body", name: "body", widget: "markdown" }
  # Our pages e.g. About
  - name: "pages"
    label: "Page"
    folder: "pages"
    create: false # Change to true to allow editors to create new pages
    slug: "{{slug}}"
    fields:
      - { label: "Title", name: "title", widget: "string" }
      - { label: "Publish Date", name: "date", widget: "datetime" }
      - { label: "Permalink", name: "permalink", widget: "string" }
      - label: "Navigation" # https://www.11ty.dev/docs/plugins/navigation/
        name: "eleventyNavigation"
        widget: "object"
        fields:
          - { label: "Key", name: "key", widget: "string" }
          - { label: "Order", name: "order", widget: "number", default: 0 }
      - { label: "Body", name: "body", widget: "markdown" }
  • Without this line the admin shows "No entry". If I create a new post and upload an image, the image is displayed (/static/img/image.jpg)
  • With this line the posts are displayed in admin but the img src is wrong (image.jpg). I also noted that I don't see all the images from /static/img in "Medias", only the images uploaded in the folder with .md

from eleventy-netlify-boilerplate.

danurbanowicz avatar danurbanowicz commented on May 6, 2024

@ced64k

I'd like to be able to help you with this issue, but time is a problem for me right now and CMS post images are not yet within the scope of this boilerplate, so I am going to have to close. Sorry about that.

I'm sure you've already had a look, but the Decap docs should help you figure this out if you haven't already.

https://decapcms.org/docs/beta-features/#folder-collections-media-and-public-folder

from eleventy-netlify-boilerplate.

ced64k avatar ced64k commented on May 6, 2024

Thank you @danurbanowicz I'll check 👍

from eleventy-netlify-boilerplate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.