Skip to content

mre/Creamy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Creamy

A tiny content management system similar to Perch.

Usage

  1. Open creamy.php with a text editor and configure usernames and passwords.

  2. Upload creamy.php and the creamy folder to your server.

  3. Call creamy within your static pages:

<?php require_once("creamy.php"); ?>
  1. Create a content area (an editable region) wherever you want:
<?php Creamy::content("news"); ?>
  1. Open the backend at example.com/creamy and edit the content area.

Features

Markdown support

Content areas (the text files included in your page) can be formatted with Markdown.
The syntax is easy to learn and makes for great formatting (you can also disable Markdown support altogether).

Templating engine

Creamy uses twig for templating.
It's pretty awesome. There is lots of documentation.

Themes

Themes are common parts of a website which will not be editable -- like headers, footers and sidebars. Put them into a folder called theme (relative to creamy.php). You can now use it on any page like this:

<?php Creamy::theme("header"); ?>

Variables

Let's get fancy! You can use variables in your themes and content areas:

Let's say you have a variable named {{ title }} inside a theme file. Here is how to fill it with a value:

<?php $options = array("title" => "Creamy awesomeness!"); ?>
<?php Creamy::theme("header", $options); ?>

Or you might want a different layout (here: table.html) for a content area and also omit markdown support for this area.
Here is how to do it:

<?php 
  $options = array("layout" => "table", "markdown" => false);
  Creamy::content("events", $options);
?>

Metadata

You can place metadata at the head of every markdown file like this:

author: Oscar Wilde
year: 1883
title: Personal Impressions of America (Leadville)
---
Over the piano was printed a notice:  
Please do not shoot the pianist. He is doing his best.

The first three lines are interpreted as metadata and can be used in your templates like this:

{% for post in posts %}
  {{ post.title }}, written by {{ post.author }} in {{ post.year }}:
  {{ post.text }}
{% endfor %}

FAQ

Q: A CMS...oh really? Why don't you use one of the gazillion other systems?

A: I want a lightweight CMS that happily adapts to static layouts not the other way round.

Q: Why not use perch instead?

A: Creamy is more flexible and it is free software. You can modify it to your hearts content. Furthermore it's file based. You don't need a database to run it. Also, I personally prefer an erb/mustache/twig-like templating engine over the XML-style one that comes with perch.

Q: Why not use jekyll instead?

A: I love jekyll. I use it for my own blog but it's cumbersome to configure and has no admin backend for my clients. You can think of creamy as a user-friendly jekyll clone.

Q: Who might want to use it?

A: Creamy is ideal for small web pages. It doesn't get into your way and helps you get some dynamic elements into otherwise static pages real quick. You can create a simple template and publish content in no time.

Hackers can also use source control software like git or svn and a plain text editor to manage sites.

Credits

This piece of software relies on fantastic work by lots of creative people.

Copyright

Copyright (C) 2011 Matthias Endler
http://www.matthias-endler.de

License

GNU General Public License version 3.
See LICENSE.txt for details.

Releases

No releases published

Packages

No packages published