You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// in ./keystatic.config.tsimport{config,fields,collection}from'@keystatic/core';exportdefaultconfig({storage: {kind: 'local',},collections: {post: collection({label: 'post',path: 'src/content/post/**/',schema: {//...content: fields.markdoc({label: 'Content',description: 'The content of the post',}),},}),},});
Each new entry (post) is saved in src/content/post/<POST_SLUG>/index.mdoc.
So far so good...
The content field has a Markdown editor UI where we can upload images, and these images will be saved to src/content/post/<POST_SLUG>/content/<IMAGE.JPG>.
I need that instaed images can be saved in the root directory of the entry, not inside content subdiretory.
Like this src/content/post/<POST_SLUG>/<IMAGE.JPG>.
What I tried
Adding options to fields.markdoc
content: fields.markdoc({label: 'Content',description: 'The content of the post',options: {image: {// This path is relative to root project, not entry directory// So it cannot do what i needdirectory: ".",// This function receive only the filename of the image, not the save path.// i.e.// If image is saved in `content/<IMAGE.JPG>` this function `originalFilename` is `<IMAGE.JPG`>// So it cannot do what i needtransformFilename(originalFilename){returnoriginalFilename;},}}}),
What i'm requesting
Ability to define path where an image will be saved , relative to the entry directory.
Or it is already possible ?
The text was updated successfully, but these errors were encountered:
With this keystatic config
Each new entry (post) is saved in
src/content/post/<POST_SLUG>/index.mdoc
.So far so good...
The
content
field has a Markdown editor UI where we can upload images, and these images will be saved tosrc/content/post/<POST_SLUG>/content/<IMAGE.JPG>
.I need that instaed images can be saved in the root directory of the entry, not inside
content
subdiretory.Like this
src/content/post/<POST_SLUG>/<IMAGE.JPG>
.What I tried
fields.markdoc
What i'm requesting
Ability to define path where an image will be saved , relative to the entry directory.
Or it is already possible ?
The text was updated successfully, but these errors were encountered: