Linux Today: Linux News On Internet Time.

Apache Today: Web Automation: Generating Dynamic Tables of Contents

Jun 21, 2000, 16:08 (0 Talkback[s])
(Other stories by Matthew Keller)

[ Thanks to Kevin Reichard for this link. ]

"In my last article, I described how to make a Dynamic Directory Index using a Perl CGI. ... This is nice if you have a hierarchical Web directory structure and want to strategically place these CGIs in high-traffic or frequently added/updated areas. But what if you want a table of contents that listed every index.html page? By slightly modifying our script from last time, we can turn our one-deep directory index, into a full-blown table of contents generator--and even a search engine, with a little ingenuity."

"Apache is pretty much ready to go if you want to implement these features. You might want to change the AddHandler directive for cgi-script, as I have demonstrated below, and turn on ExecCGI for whatever directory you have this script housed:

AddHandler cgi-script .pl .cgi"

"...here's what this script needs to do (condensed a bit):

  1. Obtain a list of directories
  2. For every directory, open the index.html file and extract the title of the page
  3. Print back the title, with a link to the page
  4. Dive into the directory, and back to Step 1"
Complete Story

Related Stories: