Intro
Starting with the new presence I've created a Sitemap so that my visitors can easily find their way through the site. I used sitemap written by Eric S. Raymond for this. But I wasn't fully content with it, because I wanted a hierarchical view. I tried to extend sitemap but wasn't successful. So one weekend when I wanted to learn Python, this problem came to my mind. I tried this project to learn Python.
The result is Sitemapper. It suffices my needs, although I have a small TODO list left.
The script works fine on my Debian box. I haven't tested it on any other machine. If you run into problems, please mail me so we can try to solve the problem.
Note
This script has now become obsolete because of gelapas. Used in conjunction with altoc, this is a more powerful tool then sitemapper. You can still go on and download sitemapper, but I most probably won't include any fixes or new features.
But how can you get the same with gelapas and altoc? I use the
following command line:
gelapas -lftd | altoc -tsitemap.templ
(Of course there are some excludes and I have the start dir
set). This is the important part of the template:
{
$prev_level = 0;
for $row (@CSV) {
$level = int(@$row[0]);
$relfile = @$row[1];
$title = @$row[2];
$desc = @$row[3];
if($desc ne "") {
$url = "/en/$relfile";
if($level > $prev_level) {
$OUT .= "<dd><dl>"; $prev_level = $level;
} elsif($level < $prev_level) {
$OUT .= "</dl></dd>"; $prev_level = $level;
}
$OUT .= "<dt><a href=\"";
$OUT .= $url;
$OUT .= "\">";
$OUT .= $title;
$OUT .= "</a></dt>\n";
$OUT .= "<dd>$desc</dd>\n";
}
}
}
I have built a script to create sitemaps with gelapas and altoc.
If you're interested in using this two tools it might be a
very good point to get started.
Download
Support
I opened a SourceForge project for sitemapper so you can file your bug reports or feature requests there.