6.2. The Format of an Entry

PyBlosxom entries consist of three parts: the title, the metadata, and then the body of the entry. The first line is title of the entry. Then comes the metadata of the entry (if any). After the metadata comes the body of the entry.

The title consists of a single line of plain text. You can have whatever characters you like in the title of your entry. The title doesn't have to be the same as the entry file name.

The metadata section is between the title line and the body of the entry. It consists of a series of lines that start with the hash mark (#), then a metadata variable name, then the metadata variable value.

Warningdon't store the mtime in metadata
 

Unfortunately, you cannot store the mtime of your blog entry in the metadata of the entry itself. The problem here is that we don't open the file and parse it for every blog entry to figure out what to display. By the time we've opened the file and parsed it to see the metadata inside, we already know which blog entries to show and it's too late to re-sort them.

The body of the entry is written in HTML and comprises the rest of the entry file.

Here's an example first post entry:

Example 6-1. first post

This is my first post!
<p>
  This is the body of the first post to my blog.
</p>

Here's a more complex example:

Example 6-2. more complex first post

The rain in Spain....
<p>
  The rain
</p>
<p align="center">
  in Spain
</p>
<p align="right">
  is <font color="ff0000">mainly</font> on the plain.
</p>

Here's an example of a post with metadata:

Example 6-3. first post with metadata

The rain in Spain....
#mood bored
#music The Doors - Greatest Hits Vol 1
<p>
  The rain
</p>
<p align="center">
  in Spain
</p>
<p align="right">
  is <font color="ff0000">mainly</font> on the plain.
</p>

The metadata variables here would be available in your story template. So for the above example, the template variable $mood would be filled in with bored and $music would be filled in with The Doors - Greatest Hits Vol 1.