decaporg / decap-cms

A Git-based CMS for Static Site Generators
https://decapcms.org
MIT License
17.66k stars 3.02k forks source link

meta: path should allow for blank paths upon publishing...fallback to path: #7094

Open pleasantone opened 4 months ago

pleasantone commented 4 months ago

I don't want a user to have to specify a path when 99% of the time, decap-cms already does the right thing, but I do want a user to be able to override/move a file upon edit if necessary.

I've added the meta: path: fields to my configuration:

  meta:
    path:
      index_file: index
      label: Path
      required: false <----
      widget: string

When I create a new page, the path field shows up on top, as expected. If I do not fill in the path field, it won't let me publish, giving me the error message:

%{PATH} is not a valid path

Screenshot 2024-02-06 at 10 29 58 PM

However, it really isn't necessary for there to be a non-blank path field upon publishing. If I hadn't added meta: path: in my config, it would have defaulted to the path: and slug: parameters. With an unspecified path, it should do the same rather than refuse the publish.

decap-cms-app 3.1.1 decap-cms-core 3.3.1 decap-cms 3.1.1

CMS configuration https://gist.github.com/pleasantone/b7002738f89ae039cc9a72a21fc69c8f