[TriLUG] creating a index page dynamically

T. Bryan tbryan at python.net
Sat Sep 24 17:34:23 EDT 2005


On Saturday 24 September 2005 13:39, Chris Bullock wrote:
> I have a web server that is just a bunch of html documents.  I have an
> index page that links to each of the documents.  Is there a script in
> apache or bash that can create an index page that links to each of these
> files, so that everytime I add a file i do not have to edit the index
> page.

If you don't want to use the auto-index page generation that Apache can 
already do, you could try ESR's sitemap script.   
http://www.catb.org/~esr/sitemap/

You can run it via CGI and have it generate a sitemap for your pages on the 
fly.  Or you could run it by hand to regenerate your front page every time.  
Here's an example of the default look of the output.  
http://www.catb.org/~esr/sitemap.html

Note that the sitemap will include certain information from the meta tags in 
the HTML files, so that you can get some description of the file with the 
link.  You can also configure it to ignore certain files and subdirectories.  
If you know python, you can start with that script and tweak it as much as 
you like.  For example, here's a simple extension of the current script: add 
CSS classes to the output so that a simple stylesheet could be used to vary 
the output and make it look less plain.

Disclaimer: my name is in the sitemap credits, so my advice is not entirely 
unbiased.   :-)

---Tom




More information about the TriLUG mailing list