Theme is a simple tool that wraps a template around a webpage
to easily set up a consistant appearance for all the pages in a website.
It can be run as a cgi script with
ScriptAlias or it can be run
from the command line as a (sort of regular) program.
When started, it looks for the file
page.them in the current
directory, then in each of the parent directories up to the document
root. If it doesn’t find one, it fails, but if it finds one, it copies
it out, doing various substitutions on it as it goes. If theme encounters
?> html command, it substitutes
page.themewas found. If you’re looking at http://www.pell.portland.or.us/~orc/Code/ragbin/theme/index.text, and the theme is at
/ >tags for the page.
?>is the same as
?>, with the notable exception of
title?>, which adds
</title>to the output while
<theme $title>does not.
You can set various things in the webpage itself, by defining them
at the top of the page before any of the content. When
runs, it picks any variables (set by
:=rest of line)
out of the file and saves the rest of the file for inclusion in
page.theme. You can also set some of the variables by an obsolete
method of name
:rest of line
set metaexcept that multiple
meta:lines will concatenate into one big meta variable.
/~user, theme will cheerfully spit out an error page and quit.
ScriptAlias, but must run it from the command line.
Theme uses my configuration system,
which is sort of like the FSF’s system (except that you run
configure.sh instead of
option tells you all the settings you can change. There are two
custom settings that are important to properly set;
--with-user-dirsets the directory under
/~user which contains their html files. This is normally
htdocs, but can be set to anything (including
., which makes all of that users files accessable to
themeand the rest of the world .)
--with-pageschanges the types of files that
themewill process. If this is not set,
themewill only process files that have a
.htmextension. Provide a colon-separated list of extensions to change this.