@ Loup's Impossible? Like that would stop me.

How to skin your site

You will have noted that the default appearance of the web site is a bit spartan. Plus, it features text you didn’t even write in the first place. You probably want to change that before you release the actual web site.

Take a look at your _ussm/ directory.

$ ls -F _ussm/
tmp/  www/  settings  skin.html  ussm
$

skin.html

This is the first file you want personalise. By default, it looks like this:

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title><?module title ?></title>
    <meta name="description" content="<?module description ?>"/>
  </head>

  <body>
    <header> <h1>Default header</h1> </header>

    <nav>
      <a href="/">Home</a>
      <?module menu ?>
    </nav>

    <article> <?module core ?> </article>

    <footer>
      Default footer. Legalese typically goes here. <br />
      If you have <em>any</em> trouble using
      <a href="http://loup-vaillant.fr/projects/ussm">USSM</a>,
      please <a href="mailto:l@loup-vaillant.fr">send me an email</a>. <br />
      Your confusion is my problem.
    </footer>
  </body>
</html>

This is valid HTML, except for those <?ussm xxx?> things. they are place holders for content specific to each page. Everything else is shared among every pages. Here, we have 4 different place holders:

Those place holders generate reasonable code by default, you probably don’t need to tweak them. Otherwise, you can edit the setting and ussm files.

settings

This file contains the default parameters for USSM. Here it is:

{
  boring: ^_\n.*~$\n^#.*#$
  source-extension: txt
  html-processor  : markdown
  default-language: en
}

(Note that it looks like a source file header: indeed, it is of the same format.) Currently, USSM uses 4 different settings:

ussm

Where everything happens. Literally. _ussm/ussm is the executable file that gets invoked when you compile your web site. The main ussm command does only two things:

With this approach, USSM can be anything you like. you just have to edit your _ussm/ussm file, which by default is a shell script. Here is its whole content:

#! /bin/sh
# Clean up
rm -rf _ussm/tmp/ _ussm/www/

# Copy the directory structure
for dir in $(ussm-source-dirs); do
    mkdir -p _ussm/tmp/$dir
    mkdir -p _ussm/www/$dir
done

# Copy every non-boring files
for file in $(find . -name _ussm -prune -o -type f -print |\
              ussm-remove-boring); do
    ln $file _ussm/www/$file
done

# Run the modules
ussm-core
ussm-title
ussm-description
ussm-menu         # must be run after ussm-title

# Put together the web pages (must be done after the modules)
ussm-assemble

Most of it should be obvious. We need a few more words about the modules though.

The modules are programs that generate a “module file” for each source file, and put it in the _ussm/tmp/ directory. For instance, the ussm-core program will generate the _ussm/tmp/foo.core from foo.txt. Currently, there are 4 modules: