-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Generate and edit config through CMS UI #341
Comments
Related to #322 |
This would be awesome 💯 |
It would be good to be able to have an option to disable this as well -- if you are building it for a client, for example. |
I was thinking about starting to try to tackle this. Is anyone currently working on it? |
@americool not that I know of - we'd love your contributions towards this. I think the best strategy for tackling this would be to use the CMS editor with a stub config that allows you to edit the |
The main challenge with this is that the backend config must be made available separately from the rest of the config, so the CMS knows where to get the remaining configuration (along with other content). The other issue is dealing with the GitHub API's intermittent caching delays when editing single files - having configuration in a state of flux could have harmful consequences. |
@Benaiah I'm not 100% sure, you'll have to forgive me I haven't touched the repo in a month or two so I'm still getting reacquainted with it. That being said, I think what you suggest makes sense. I imagine, looking at the example page (which I assume I can tackle this problem from...but maybe not) within the settings sidebar option we also want a link to "Edit Config" which would then render (some) of the config options and allow the user to edit and save them (via github API PR/Merge)? Any any pointers as to where to start would be great, I also just want to make sure I'm not barking up the wrong tree. |
I've been messing around with it for a while now, I think I following @Benaiah's suggestion makes sense and was the approach I found myself naturally moving towards (that is - if I'm clear on what is meant mean by stub config.) @erquhart's points definitely need to be addressed, but I'd like to get just the most basic stuff up and running on my end first. Alas I'm currently having a little trouble actually getting a file collection to render appropriately - can someone point me in the direction of where the test-repo data is? (Particularly something along the lines of file: "_data/authors.yml") so I can see what I'm doing wrong? thanks! EDIT: found the creation of _data folder in the index.html inside of the example folder. Still struggling to get a mock config file to render though...I'll keep working on it. |
@americool don't use the test backend for this, not even to get the ball rolling. The CMS has to load an actual config file, which the test backend can't provide. Instead, set up a repo to test against, and create a new file type collection pointing at "config.yml". You can start with just a partial definition of the config file - maybe a non-existent field, so you can see it in action. We're here to help, feel free to comment back with more questions. |
Alright thanks, I can do that with my repo, I'd just avoided it because for whatever reason it takes a short lifetime to start up. |
If you're not already, try using yarn. Well, that'll help with install speed, anyway. |
I've got yarn, but that doesn't really make a huge difference on the build time on the cms, might be a little shorter, but it's not notable. I maybe misunderstanding, and hopefully there's a much better way to do this, but if I'm not using the test backend I'm currently running my jekkyll site locally and having it point to my cloned copy of netlify, which is where the real stop gap seems to be since every time I change anything, it takes about 3 minutes to re-serve the site. (I've tried using the example config file to point at my repo instead of the test-backend, but while it can render my post collections, it doesn't seem to recognize the config as a file collection, or any other sample file I try to make to test it out.) That aside, when running off my site with the local cms copy, I can get it to recognize the config file (at least pop up as a link, and it allows me to navigate to a new page and add more data) but using that or a much simpler file I attempted just to test out never seems to render the already existing data. I'm probably missing something obvious, but feel free to have a look at the config file, currently with the couple of fields I have for the config collection it's kinda in a forever-load/break and the test .yml (something else) won't read the existing data, which is the behavior the config collection was exhibiting before attempted to put proper fields in. https://github.com/americool/americool.github.io/blob/morenetlify/admin/config.yml |
@americool join us on Gitter, it's a better format for this kind of discussion. That said, I will say that your current problem is probably that you're using the List widget instead of Object. |
Thanks! Will do. |
Design needs for 1.0 are more polish; longer tail could involve larger design redo |
Related to #534. I'm not sure the resulting interface should simply be 1:1 UI for the config, per se. Most of the configuration should be editable in this UI, but it should be a higher level unified Settings UI that is itself configurable and extensible. |
As @Benaiah has mentioned, that strategy will not work to solve this issue. Why @Benaiah idea will not work?As I understand how NetlifyCMS work, it reads the Neither NetlifyCMS allows us to add additional widgets using the interface. So, it will be just like editing the pre-defined fields using the NetlifyCMS, which is of no use. How we can implement issue #341?Using Layouts (optinal)We need to create layouts. NOTE: Do not mix layouts with collections. What are the layouts?Layouts will be a set of fields and widget (just like we do in the collection). For example: I will create a layout name Which include the following widgets:
and now we can use this layout for whichever collection we want. What's the difference between collection and template?According to the NetlifyCMS docs of collection, we can define fields based on folder or files. Sometimes we might duplicate the fields in the collections. That's why we need to use layout. Where we can create layouts in a file Adding/removing widgetsWe need to allow users to edit the layout or collection by adding and removing fields directly from the interface. Auth.yml file
Since the user has to provide some authentication details before NetlifyCMS take over. That's why, instead of creating a In which the users will only provide the detail related to auth so that NetlifyCMS can connect to the Inside the backend:
name: github
repo: owner-name/repo-name
branch: master
auth_key: xxxxxxxxxxxxxx
app_key: xxxxxxxxxxxxxxxxxxxxxx All the available auth options. Inside NetlifyCMSOnce the user is inside the NetlifyCMS there should 3 pre-defined sections.
Site settingsThese settings can be included in the site settings. For example:
and the same goes for the other two, layout and collections which follows the rule of adding/removing widgets using NetlifyCMS. |
Thanks for the thoughtful breakdown @mittalyashu! We'll generally want to maintain a physical
For now this should be considered a future improvement, likely post-3.0 (which is scheduled for December). In the meantime, @talves has published a fantastic external configuration editor, you can find it here: https://netlifycms-configurator.netlify.com/ |
It seems like the first step is to design the interface only. I have started working on the new design for NetlifyCMS and I am happy to discuss about it in they community discussion. |
@mittalyashu definitely, designing the interface is the first step - we're just not ready to take that step yet. I think I mentioned this to you elsewhere, but we're not looking to overhaul the design of Netlify CMS right now. Definitely interested in specific, focused improvements, though. Can you reach out to me on Gitter if you have questions on that? |
this would help add a new folder collection directly from the CMS UI, instead of having to manually create the config and adding the folder in the site repo for a new folder collection. This is especially useful for creating multiple blogs on the same site. |
Creating config entries manually is a huge pain point. It's slow and cumbersome. Even a crappy standalone UI that knows about the NetlifyCMS config spec and allows you to plop in your current config.yml to edit it would be amazing. Having it integrated directly into the site admin would be icing on the cake. |
Omg, I just found this thread but I just finished my own version of an external tool to edit the config file. Well, I know that @talves developed something similar in the past, but now that I'm here, I'd like to share my tool too: It's an open source project hosted on https://github.com/Kinark/netlify-config-builder |
@Kinark AMAZING |
@Kinark this is awesome! The docs are a little slim for this tool, would you mind giving a little more information on how it works and how exactly it addresses the issue in this thread? Would love to try it out! |
@BranonConor Thanks and oc! It's a simple third party tool to generate and edit the config.yml. On the left side you can create and select Files/Folder collections. On the right side, you can edit them. It's pretty intuitive and you can import your own YML files into it. Just use it for a while and you'll get it :D |
@austincondiff Jesus Christ, you, my friend, did a great work over there. Of course, we can use it! I'm 100% into your vibe. If you want, contact me by email ([email protected]) so we can work on a PR together to implement your new UX. I'm a designer myself (besides developer), so I believe I can help you if you want :) |
@Kinark I just sent you a slack invite. Send me a DM when you join and I’ll get you up to speed with where things are at. |
@Kinark awesome thanks so much! I have been messing around with it and I noticed the yaml file it spits back out is in a different format then what I had originally based on NetlifyCMS docs, will it still be read properly? For example what may have looked like this:
Becomes:
|
@BranonConor Yep, it looks different cause it's been translated between JSON and YML some times, but it should work as expected! |
I used theNewDynamic/hugo-module-tnd-netlifycms to create a CMS generator using Hugo. Check it out at basa-casa/hugo-module-bc-nc-admin, with a preview available at https://netlify-cms-generator.netlify.app/nc-admin/#/ |
- Do you want to request a feature or report a bug?
Feature
- What is the current behavior?
Users must manually create a config in yaml
- What is the expected behavior?
Users should be able to configure the CMS through the UI. The output is still just a yaml config file that is version controlled.
Considerations:
backend
The text was updated successfully, but these errors were encountered: