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
a <?theme
command?>
html command, it substitutes
body
cwd
<?theme
cwd?>
is /~orc/Code/theme
.)root
page.theme
was found.
If you’re looking at
~orc/Code/ragbin/theme/index.text>,
and the theme is at /~orc
,
<?theme
root?>
is ../../
.title
<title>
and </title>
.meta
<meta
…/ >
tags for the page.$
name<?theme
command?>
is the same as <?theme
$
command?>
,
with the notable exception of <?theme
title?>
, which adds
<title>
and </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 theme
runs, it picks any variables (set by set
name:=
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
sccs
set sccs
title
set title
meta
set meta
except 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 configure
). The --help
option tells you all the settings you can change. There are two
custom settings that are important to properly set;
--with-user-dir
sets 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 theme
and the rest of the world .)--with-pages
changes the types of files that theme
will
process. If this is not set, theme
will only process files
that have a .html
or .htm
extension. Provide a colon-separated
list of extensions to change this.