Example code

Here's a very simple example of a PostCMS web template:

<html>
<head>
<title><page:name/></title>
<link rel="stylesheet" type="text/css" href="css/basic.css"/>
</head>
<body>
<xyz:header/>
<div class="main">
<h1><content:string id="headline"/></h1>
<content:text id="summary"/>
<br/>
<content:text id="body"/>
</div>
<xyz:footer/>
</body>
</html>
There are three kinds of tags in addition to the usual XHTML tags. First, there are tags like <page:name/> that just output metadata about the current page.

Then there are the <content> tags, that are used to define editable areas in the template. These are the only bits that content authors will be able to change.

Finally, there are reusable components that you have created for your site. Your account name is used as the prefix for these; in this example the account is named "xyz".

You'll notice that you can mix in whatever other page markup you like with these tags (including PHP). You don't have to have a "header" component, or structure your page in any particular way.

Of course, real examples are likely to be a bit more complicated than this, but you get the general idea. Visit PostCMS Labs for comprehensive documentation.