decaporg / decap-cms Goto Github PK
View Code? Open in Web Editor NEWA Git-based CMS for Static Site Generators
Home Page: https://decapcms.org
License: MIT License
A Git-based CMS for Static Site Generators
Home Page: https://decapcms.org
License: MIT License
I'm grouping a bunch of minor issues for the text editor here to avoid creating a bunch of small tickets. Feel free to split them up if any of them need more discussion.
User needs:
UI: Show each of these types of posts in a kanban-style view, with 3 columns (see wireframe here: https://phae.github.io/netlify-sketch/review.html)
Acceptance criteria:
I've set up a demo blog using the Jekyll + netlify CMS starter project and I get an issue where deleting a post through the CMS causes the following files/folders to also be deleted:
To reproduce:
This doesn't happen when deleting a post if there are others, just when deleting the last post so there are no posts left.
Might be good to integrate this? https://github.com/tomkp/react-split-pane
On the README there is a section with an example about how to setup a select dropdown widget.
https://github.com/netlify/netlify-cms#extending-and-overriding
When I drop in the example directly as shown I get the following error.
Uncaught TypeError: Cannot read property 'isLegacyViewHelper' of undefined
vendor.js:16670
Any thoughts?
I am using jekyll and running the site locally.
These are the contents of my admin/index.html
file
---
---
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Content Manager</title>
<!-- Include the stylesheets from your site here -->
<link rel="stylesheet" href="/css/main.css">
<link rel="stylesheet" href="//cms.netlify.com/assets/cms.css" />
<!-- Include a CMS specific stylesheet here -->
<!-- Set the CMS environment -->
<script>window.CMS_ENV="{{jekyll.environment}}";</script>
<base href="/admin/">
</head>
<body>
<script src="//cms.netlify.com/assets/vendor.js"></script>
<script src="//cms.netlify.com/assets/cms.js"></script>
</body>
</html>
{% raw %}
<script type="text/x-handlebars" data-template-name='components/widgets/author-control'>
<div class="form-group">
<label>{{widget.label}}</label>
{{view "select" content=widget.field.authors value=widget.value}}
</div>
</script>
<script type="text/x-handlebars" data-template-name='components/widgets/author-preview'>
Written by
<span class="author">{{widget.value}}</span>
</script>
{% endraw %}
In the demo site, edit a post, then click "New Post" from the dropdown in the header. Now preview pane is stuck with the old post.
This refers to using a orphan branch to store metadata.
Note: The action of creating a new item should map onto the Github concept of a PR.
Acceptance criteria:
Technicalities of when PR is merged in are up to implementer - the stuff I said are just suggestions - it might make some sense to simply use a comment on a PR to note if something is "good to go live" rather than merge at that point, but I'll let those that know best decide. :)
Pick up the header/search box design, background colours and text styles that are already on the ember prototype.
I can work with whoever grabs this to tweak after that.
We should at first have starter sites for:
Later there are more to come and themes etc, would be great. But these four seems like the most important to start with.
When a user clicks "delete" on a post it still shows up on the posts list. The user has to do a manual refresh before it goes away.
/admin/#/collections/blog
User needs:
Currently, there is no way in the UI to return to the overview. Add a link in the top bar to return home (index / overview).
Acceptance criteria:
Recent updates appear to have broken netlify-cms in some way. I am getting on the error below on https://moonsquads.netlify.com/admin/
Error while processing route: index.list Cannot read property 'loadEntries' of undefined TypeError: Cannot read property 'loadEntries' of undefined
at loadEntries (https://cms.netlify.com/assets/cms.js:2405:29)
at prepare (https://cms.netlify.com/assets/cms.js:2399:12)
at setupController (https://cms.netlify.com/assets/cms.js:4160:18)
at superWrapper [as setupController] (https://cms.netlify.com/assets/vendor.js:30338:22)
at _emberRuntimeSystemObject.default.extend.setup (https://cms.netlify.com/assets/vendor.js:35136:12)
at Object.callHook (https://cms.netlify.com/assets/vendor.js:58320:38)
at handlerEnteredOrUpdated (https://cms.netlify.com/assets/vendor.js:57100:12)
at setupContexts (https://cms.netlify.com/assets/vendor.js:57068:9)
at finalizeTransition (https://cms.netlify.com/assets/vendor.js:57246:7)
at https://cms.netlify.com/assets/vendor.js:56681:14
see TODO.md#formats
Is it possible to manage multiple sites using the same admin instance in netlify? If not, how complicated would it be to add such a feature (and is it on the roadmap already?)? I don't have much experience with Ember, but this is one feature I'm looking for. The multiple backends feature that netlify has seems really cool., and generally, it seems like a very nice looking UI for static site generation.
User needs:
As an MVP of basic discussion on PRs, add a panel to the side of the edit screen to house information.
For now, just list the major actions. See: https://phae.github.io/netlify-sketch/review.html (the coloured boxes in particular showing status changes) Commenting etc. can go in a seperate issue.
Acceptance criteria:
I assume this whole thing is done to enable non-tec users like grandma to edit things.
But grandma has Libreoffice and she knows how to do tables, believe me.
Unfortunately grandma can not find any way to create or copy paste a table into this editor.
She would be happy, if she had a way to import a csv file.
I am now teaching her markdown - but then we do not need this editor anymore. Also she is laughing at me because she does not believe that tables with markdowns are so primitive, plus she just wants to copy-paste.
Conclusion: please do not stop development just because the most ultra-simplistic things are implemented - a product like this should also support tables.
User needs:
In the first column of the workflow, add a link beneath the first heading to "add a new post".
See wireframe: https://phae.github.io/netlify-sketch/index.html
Acceptance criteria:
MediaFolder should allow for the specification of both a source and a public paths.
As a gitlab user, it would be nice if you support gitlab too as the backend :)
User needs:
Acceptance criteria:
ability to have a custom commit message for the next save
i have tried setting up a netlify-cms instance configured to use a local netlify-git-api backend:
backend:
name: netlify-api
url: http://localhost:8080
the netlify-git-api daemon is running and accessible via HTTP on localhost, but the netlify-cms instance always tries to authorize via github.com. the app/backends/netlify-api.js
module in the master branch of netlify-cms has references to https://github.com/netlify/cms-local-backend, which i imagine was an earlier name for the netlify-git-api repo: is the netlify-git-api backend supposed to be functional in master (i may have misconfigured its use somehow)?
Hello Developers,
I make my first steps with the Netlify CMS and do not understand how one can realize GitHub as a backend. I've already prepared everything on GitHub.com in own account for and have generated the client ID and Secret Key.
But I do not understand where you can find Access tab in the Dashboard. I see in the browser at /admin no such tab and does not find it. Or do I have to GitHub.com anywhere the client ID and Secret Key Enter?
Can you maybe help me figure it out ?!
Thanks in advance.
It shouldn't be possible to delete a post if create: false is set in the config.yml file
Implement Rich Text Editor, with the following characteristics
User needs:
So, we should add some basic filters to reorder the list of posts that have already gone live.
Minimum options for now.
Acceptance criteria:
While the live preview in the style of the site, should lower the need to publish draft versions before publishing the live version of an update, Netlify CMS still ought to have some handling for drafts.
Here's a few options for draft handling:
A lot of static site generators have support for draft content, typically in one or two ways:
It's definitively viable to build an abstraction on top of this, exposing a method to fetch all drafts, promoting a draft to published or demoting a published post to a draft.
The tricky part here is how to handle preview builds.
One option that comes to mind here is adding support on netlify's end to indicate a draft build in the commit message. The downside of this is that this would tie the draft feature a lot to netlify unless other continuous deployment services added support for the same commit message format...
The other option is to ignore the built-in support for drafts in the different static site generator and use git branches for draft handling.
One way to handle drafts is to automatically create a new branch for each draft and trigger a pull request. Netlify has built-in support for doing preview builds of pull requests and this is something that can also be configured with other continuous deployment setups like Travis-CI.
This does leave the question of how to get the preview URL for the pull-request build back to the content editor?
Another option is a staging branch. With netlify a really common pattern for sites is to have a private staging version of the site that builds from one branch and a production version of the site that builds from the master branch.
The very simplest draft handling in this case would simply be to have content editors just work with the CMS on the staging branch and always just see staging previews.
However, actually merging changes into the production branch can be tricky since we can't really guarantee that the changes can be trivially fast forwarded, if someone has been doing work directly against the master branch. On sites with many content editors it also makes it tricky to publish changes gradually. If several content editors are working on drafts for different entries, then simply merging the staging branch into the master branch would publish all of them.
Not sure if there's a way to handle this without accidentally introducing a lot of the complexity of handling branching and merging in git to content editors (which is a no-go).
What's the main use-cases for drafts? Any other ideas for draft implementations?
Permission control through roles would be great. Supporting the same roles as ghost would be great here:
This can be enforced by storing a .netlify-cms.yml file with role permissions in the git repo and reject/permit commits through a git hook that reads this yml file.
User needs:
Rather than show ALL posts in the overview forever and ever, just show the first 20, and paginate there after. Given the new proposed wireframe, it would actually make a lot of sense to do a "show more" button at the bottom and incrementally add more posts to the end of the page.
Acceptance criteria:
Like the image field, but for a bunch of images that can be reordered, etc.
The list widget with an image widget can do the trick, but galleries are so common that it would be great to have a robust ui for it.
(EDIT by @tech4him1 to fix link and add quote)
Creating new posts in the admin UI fails to prepend the date to the filename.
Specifying a layout template per content type isn't clear in the README. For example, Jekyll frontmatter for a post should include layout: post
. This isn't being generated with new posts. How should this configuration be made?
Image widgets used normally prepend the correct path to the uploaded image, based on the media_folder
and public_folder
keys in config.yml
. However, if you use the image widget as part of a list widget, then the media folder is set to null
. I presume that this is something to do with how the image widget is inheriting properties from the list widget.
The code I'm using to generate the list looks like this:
## config.yml
...
media_folder: "src/images/uploads" # Folder where user uploaded files should go
public_folder: "src" # strip this from the media_folder
collections:
- name: "post" # Used in routes, ie.: /admin/collections/:slug/edit
label: "Post" # Used in the UI, ie.: "New Post"
folder: "src/content/posts" # The path to the folder where the documents are stored
sort: "date:desc" # Default is title:asc
create: true # Allow users to create new documents in this collection
fields: # The fields each document in this collection have
- {label: "Title", name: "title", widget: "string", tagname: "h1"}
- {label: "Subtitle (optional)", name: "Subtitle (optional)", widget: "string", tagname: "h3", optional: true}
- {label: "Featured Image (optional)", name: "featuredImage", widget: "image", optional: true}
- {label: "Content", name: "body", widget: "markdown"}
- label: "Image Attachments"
name: "imageAttachments"
widget: "list"
fields:
- {label: "Description", name: "description", widget: "string"}
- {label: "Image", name: "image", widget: "image"}
The image widget used for featuredImage gets the path fine (i.e. images/uploads/filename.jpg
), but the image widget used in imageAttachments
gets null
(i.e. null/filename.jpg
).
I note that on the TODO page there's a suggestion that you could make a gallery widget by using an image widget in a list (which is where I got the idea) so I assume that this use case has been tested โ am I just missing something in the config?
Cheers,
Sam
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.