julianoappelklein / hokus

A modern CMS for Hugo
https://www.hokuscms.com/
MIT License
607 stars 43 forks source link

Image Upload field not updated #72

Closed goldcoders closed 4 years ago

goldcoders commented 4 years ago

Hi Ive used bundle manager,

Ive defined key as images but it created a resources key on my markdown file. is this the normal behavious?

Also is there a way I can instruct it to upload to the ROOT path not the Relative path the file is located?

Its impossible to reference the image if not set to ROOT/static/images/*

hugo reads all images found in that directory and ship it during build process..

pic-selected-200710-1132-34

pic-selected-200710-1131-08

Can you help me with it or is this a bug?

julianoappelklein commented 4 years ago

BundleManager will only manage the page bundle resources. By design, It does not edit global static files.

That's because static files usually are something that the theme needs to take care. Hokus was created to support the editor role, not the developer role.

But there are some cases where editing the global static files would be interesting, but I would build a different UI for that. Can you tell me your case?

julianoappelklein commented 4 years ago

BTW, the key is mandatory for all fields, but in some cases they don't have a obvious utility - and this is the case for the BundleManager. They must be unique in their level.

goldcoders commented 4 years ago

@julianoappelklein the only problem im facing here is , when image is uploaded,

but the resources array , its not being filed with the src path Ive used your example on the Forms Cookbook specifically Blog Post example is the one i used... same data structure ive pasted on my hokus.toml

but there is a difference in cook book , you have something MOCK which i think is filling up that resources array , that resources array is the KEY , even if i put images as key the one being written on Hugo Front Matter is resources.

Do u have a reserve key for bundle manager i can point that holds the images data ie. path, name , extension....

goldcoders commented 4 years ago

Ive email you the fix on this... Please check