-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Store Assets Relative to Content (Bundles) #1472
Comments
Also see initial discussion in #325. |
would love that, too, i'm not yet using netlify cms but am considering it. as i'm managing my assets in an assets directory relative to the post it's not easy to migrate. |
I would like to underline this. For people that uses Apps for markdown editing this is important. Usually these Apps can render images if they are in the same directory as .md file or with absolute path, which is not useful for later deployment. If the CMS supported this feature it means we can work on our posts in the same way from our local machines and from the CMS. ❤️ |
I want this functionality and would like to lend a hand 😁. Design and possibly code help (front end). |
Great! This is a feature I'd really want too so I'd be happy to help in any way 😄 |
Do you guys have any design assets for Netlify CMS I could leverage? Someone working on the technical, backend side of this? Also, a short 5-10 min chat would be great :). |
You can view assets in our design repository on the fabulous Abstract - here's the invitation link. @Benaiah and I both work on the backend, and @talves also has a fair amount of familiarity. We generally field questions right here in the issue, or on the PR if you have one. Finally, I'm happy to have a call with you to answer any questions, I'll email you with details. |
Any news on relative assets? Just to know where we are 🤓 |
Really sorry...I still want to work on this but life got crazy. I'd like to help with design and front end possibly at some point. |
anyone interested should check out ro. it manages data just like that. we use it that way @ dojo4. https://github.com/ahoward/ro -- https://dojo4.com/blog/static-is-the-new-black |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Ok, I am going to pull the maintainer card here. The following is not directed at any one person: Before a conversation gets out of hand, make sure to adhere to the Code of Conduct Thanks. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Any update on this, for me this feature is critical for any medium size site. |
Meant to add this after the last community meeting - here's the approach we discussed:
collections:
- name: posts
label: Posts
create: true
folder: content/posts
slug: "{{title}}/index.md"
fields:
- { name: title, label: Title }
- { name: body, label: Body, widget: markdown } This approach only allows a single directory level to be created dynamically per entry, which should be sufficient. Thoughts? Use cases this wouldn't work for? |
I believe that would work for our use case on web.dev :) |
@mazdak78 Already in beta it seems https://www.netlifycms.org/docs/beta-features/#relative-image-paths 🎉 |
@CanRau : Oh, thanks, but I was mostly referring to feature about slug: "{{title}}/index.md" mentioned by @erquhart on Jun 19. :) |
@erquhart Thank you for a super useful product! Question: are you guys working on the |
Hi @erquhart, do you have an ETA for this feature? Thanks. |
What about images? Can they be stored in the same location, i.e., |
Hi everyone ! |
It’s in progress, watch here for updates Sent with GitHawk |
Latest code on master branch (not published yet to beta) lets you do: slug: 'index'
path: '{{title}}/{{slug}}' to save a file under Next step will be to store images with the content. |
Thanks a ton for implementing this feature! |
ficaria muito melhor mesmo para gerenciarmos as postagens |
Hi, I think the doc could be updated right? |
Good catch @Ir1d! removing that part will also require updating the |
hi what would happen if title has space will the folder be created with spaces or hyphen? |
@nidhi-wgl, sanitisation is still applied but only to template variables. |
@erezrokah This is still listed under beta features in the docs. Is that the case or should this be moved to the permanent docs? |
Yes we should. Opened a new issue to track this #4608 |
Hi @BasixKOR this is supported via https://decapcms.org/docs/beta-features/#folder-collections-media-and-public-folder |
Do you want to request a feature or report a bug?
Feature
What is the current behavior?
Currently, the Media Library is a single folder where every image is dumped. This doesn't allow assets to be organized, managed, and deleted properly.
What is the expected behavior?
There is work going on to add subfolders (see #1046) and provide further improvements to the Media Library (see #1321).
But I think we should go a step further than that and allow assets to be stored relative to its content (it's been asked for in various comments to media library issues). The paradigm for such asset handling is different, but I belive it is a very reasonable way to organize the content.
The Hugo SSG has been moving more and more towards this way of organizing its content and calls this Page Bundles (see Hugo Content Management with Page Bundles and Content Organization).
In this example, there are two page bundles, one for
/posts/my-post-1
and one for/posts/my-post-2
. They each have their own assets stored in the same folder.Then there is also a bundle for the overview site for
posts
(Hugo calls it a Branch Bundle).Reason for Bundles
/assets/some-unique-filename.jpg
or/assets/some/duplicated/path/to/image.jpg
.assets
folder we are never sure if some image is still referenced by some content.The text was updated successfully, but these errors were encountered: