Author: Arjan Scherpenisse
Email: acscherp@wins.uva.nl
Version: 0.50
SimpleSite is a set of scripts to generate a complete website out of a data structure (defining the content) and a theme structure defining the look of the generated site. The goal of this is to give the website a consistent look while remaining easily maintainable at the same time. The nice thing is that all html code is generated beforehand, thus effectively eliminating the need of additional scripting facilities like PHP3 or ASP.
TBD
Properties are the building blocks of SimpleSite. They make the difference. A property is a key-value pair. The key is used to reference the property in a theme, and the value is inserted on the place of the reference while parsing.
Most SimpleSite properties are specified in property
files. These files are for instance all the
.item files in sections, but also the
content/defaults file.
The format of a property file is quite simple. Every key-value pair is seperated by the parser at the first colon (:) it encounters. For instance, these properties are valid:
title: A simple website
description: This site contains: foo, bar and fubar.
It is possible to include comments in property files. Like in perl and csh scripts, comments start with a #.
# This is comment.
# Everything after the bracket will be ignored.
A property value can be quite lengthy. There's nothing wrong with that. It is possible to make a property value span more than one line. This is done by placing the property value between <-- and -->. Example:
description: <-- This is a
multilined
text. There is nothing wrong with
that,
if the ending tag is specified
like this
-->
That's basically all you need to know to make your own property files.
For some special purposes, the SimpleSite parser generates properties automatically. The automatically generated properties are the following:
site_theme - This is the theme that is used on
the current page.page_id - The name of the current page,
without it's extension.section_id - The directoryname of the current
section. Only valid in section scope, ofcourse.item_id - The id of the current item. This is
the name of the item file without its extension. Only valid in
item scope.Every site has data elements that are the
same on every page. For instance, the name of the Company or the
name of the author of the page. All this global data goes in the
content/defaults file. This file, as every data file
in SimpleSite, is in the key-value format.
content/ directory. Data that
is global for the scope of the current page, goes in the
content/pagename/defaults file. The data in
this file acts the same as the site-wide information in
content/defaults, but it is only valid in the scope
pagename. In the file you can override the
data specified on site level. For instance, if the maintainer of
every page on your site is X, but on page Y it is person Z, you
can define on site-level X as a page_author, but in the file
content/Y/defaults you can put Z's name.
In each sub page, you can define sections. Sections are simple list-like things which allow you to group data. You could have a links page with sections for gaming, one for programming, and so on.
Sections live on your SimpleSite as subdirectories of the page
you want them to be in. Additionally, you must explicitly tell
the simplesite parser you are using sections. You do this by
making a content/pagename/sections
file. This file is in the by now well-known key-value format :-)
At section level, you can again specify specific properties
belonging only to the current section. They go in the file
content/pagename/section/defaults
file, as you might have guessed.
Every section can display a list of items. Items are specified
in files in the section directory, in files with
.item extensions. Each item defines a set of
properties. For instance, when you are making a links page, each
item could represent a link. In this case you would specify in
the .item files the url of the link, the title of the linked
homepage, and maybe a short description. As long as you use one
naming convention in both your item files for this page and for
the theme, everything should go ok.
Practically, you can give any property you define a unique name. With SimpleSite however, such a use of properties isnt recommended.
We recommend a property name in the following form:
level_name
For instance, the site level properties could be ones as
site_author, site_email and
site_title. On item level, they could be
item_url, item_title or item_text.
This way, you have always a clear view on what properties you
are using when creating the look of your site. We also recommend
you first make a design on paper on what properties to use, or to
use an external GUI SimpleSite editor, for instance nqSiSi.