Question

I am building static websites with Middleman. I am finding that clients want the ability to update the site's content. I am wondering if there is a workable solution that would allow a client to update a Middleman site without them having to edit the source code.

Was it helpful?

Solution 2

Have you looked at Prose?

It's built for Jekyll sites, but you can edit any Markdown file in a GitHub repo and it will have a nice little editor. I've heard you can make the GUI editing for the frontmatter work if you mess around with the prose.yml, documented here: https://github.com/prose/prose/wiki/Prose-Configuration

I'm looking to do a similar thing and this is the best thing we've been able to come up with so far.

OTHER TIPS

Thomas Reynolds, one of middleman creators, developed Middleman Blog Editor (http://middleman-blog-editor.awardwinningfjords.com/), an extension which enable article editing through a WYSIWYG interfaced. I tried it and it is pretty cool.

I turned the question around in my head a bit by thinking about what do I have to do to update the site. I have to edit the source code in the development environment, build the site, and upload it to the server.

For the client to do this without touching the source code would require a gui editor to be built into the development environment and the client would have to be given access to this.

Middleman is a rack based application. One way to approach adding an editor would be to create it as rack middleware.

Here is a good introduction to rack and middleware. With a bit of fiddling I was able to build a simple application that allowed me to edit a middleman site's yaml files. While it was a good excercise, from my point of view, it's getting away from what makes building sites with middleman so much fun.

You can also try to implement https://www.contentful.com/developers/docs/ using their content API. They have implementations for different languages (including Ruby, which you need for Middleman).

After syncing the API with your middleman site you'll be able to create custom fields on their front-end admin GUI so your client can edit stuff.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top