decaporg / decap-cms

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

Specifying a default publish_mode value #7102

Open privatemaker opened 4 months ago

privatemaker commented 4 months ago

Following and testing the Gitea support discussed in #6984, #6997 it seems now that Decap works on Gitea and the Forgejo fork when the server is configured correctly, which is very cool 🥳

However, while testing a couple sites, I noticed the following error when using the nifty Hugo Module hugomods/decap-cms made by @razonyang

Screenshot 2024-02-07 at 18-26-15 Editor

Upon inspecting the config.yml file the module generates, which is served as decap-cms-confg.yml it seems the module is injecting publish_mode: editorial_workflow even when it's not specified. However, since with gitea this is incompatible, I tried changing value to Boolean false which shows:

'publish_mode' must be string
'publish_mode' must be equal to one of the allowed values

Also when setting it as String values "false" or "default" or "normal" it still fails with this error:

'publish_mode' must be equal to one of the allowed values

@razonyang modified his module to accept publish_mode: '' to omit the key being injected which solves this, for now. But I think Decap should also have a default value for this field.

Originally discussed in https://github.com/decaporg/decap-cms/discussions/7095