Quick Start
After you download and untar PeltonBlog, you'll find the following files and directories:
- createblog.pl - the main program which generates your blog from the contents of the blog.xml file. Be sure to edit the variables at the top of this program!
- blog.xml - your blog content.
- xmlcheck.pl - a script that you can run to check the correctness of the syntax of blog.xml. It is recommended that this be run before createblog.pl is run.
- blog - this is where createblog.pl outputs HTML blog files.
- blog/files - place all your photos, stylesheets, javascripts, etc. in here for your blog to use.
- blog/files/style.css - an example style sheet. The actual createblog.pl program generates HTML that uses some of the things in here, so I'd keep this at least for reference purposes. :-)
- blog/category - this is where blog category HTML files are generated.
- blog/article - this is where individual article HTML files are generated.
- README.txt - a copy of this document in plain text.
Now that you have an idea of what's what, scribble some stuff in blog.xml, run xmlcheck.pl, run createblog.pl, and then check out your shiny, new blog! If something doesn't look right, it either means you made a mistake in blog.xml, or you need to make a change to createblog.pl. It's open source. Edit it to your heart's content. :-)
The Blog Structure
It's really simple. It's just 3 'levels' so to speak.
- The home page has links to article category pages and the individual articles by year.
- The category pages have all the articles that are marked with the respective category, and article titles link to the individual articles.
- The individual articles pages are... uh... individual articles. Article bodies are made up of whatever HTML you want to use.
Blog.xml Syntax
Ah, simple, pseudo-XML. You're so easy.<title>Collective Soul Rocks</title> <date>2014-03-22</date> <!-- yyyy-mm-dd --> <category>music</category> <!-- amusement anthropology beer computing cycling exercise family finance food music self-help --> <body> <a href='http://www.collectivesoul.com/'>Collective Soul</a> speaks to my soul. Collectively. Or something. :-p </body> <!-- #################### BIG VISIBLE XML COMMENT WHEEEEE!!! ####### -->
Here's a few things to remember:
- The title and date is used to produce the final file name of the article, so don't put any characters in there that are not suitable for a web file name.
- Please follow the indicated date format. It's used to produce the article-by-year home page listing.
- Conform to a standard with your categories, since those are used to produce the category links and HTML files. No spaces, please. I've included some category names in the XML comment there so it's easy to copy and paste the category names without risk of typos.
- You can splatter anything you want into the body since the body is placed directly into the outputted HTML files.
- I've followed the body with a big, visible XML comment so that each article in the XML file is easily seen, which improves the editing experience.