hugomods / decap-cms

[Experimental] Hugo Decap CMS Module
https://hugomods.com
MIT License
6 stars 1 forks source link

meta_path's use is awkward... #137

Closed pleasantone closed 7 months ago

pleasantone commented 7 months ago

This may be a misunderstanding on my part.

By default, the path is calculated from path: and slug: ... it does not need to be (and probably shouldn't be) in the editable fields upon new article creation... or at least it should be optional. However, it's nice to have meta_path should one wish to rename an article. However, renaming an article doesn't necessarily carry all of the other media files over to the renamed directory if one is using a leaf bundle (section/foo/index.md) instead of bundle-less. (section/foo.md).

I'm torn on whether to include meta_path or not in my params.

razonyang commented 7 months ago

It's used by nested structure, for example, without it, it's unable to create subfolder/bundle.

content/
  news/
    releases/
      foo/
      bar/
    announcements/

You don't need it if your collection structure only have one level, and it's also optional (not included) by default, see https://github.com/hbstack/blog/blob/44959e5b5ab30535f6924e714f351838324ad8e2/modules/decap-cms/hugo.toml#L7-L26.

pleasantone commented 7 months ago

Should it be a required field? If it’s just dirpath?

razonyang commented 7 months ago

Not sure, you can find detailed information on https://decapcms.org/docs/collection-nested/.

I just use it for my multiligual and nested structure.

pleasantone commented 7 months ago

Ok I will experiment more with it and report back

pleasantone commented 7 months ago

I did a weird workaround that works kinda by accident. The problem I want to solve, is making the path field optional. I wanted to default to the string that would have been created if we had already known the title or any of the other things in the slug.

it doesn’t really need to be required.

My Kluge works by an unintended side effect. I suspect this will require a change to decap js.

see https://github.com/goattrails/hb-goattrails/blob/84bc207be510abffdf31a8fc0002c02de6322df0/config/_default/params.yaml#L362

pleasantone commented 7 months ago

I'm going to close this, as it's really a decap-cms issue and I've filed an issue there.

https://github.com/decaporg/decap-cms/issues/7094