Navgen

Description

Navgen is a very simple little cgi script that automatically adds <link rel=""> navigational links into the headers of your pages to make the Site Navigation Bar feature of Mozilla and Opera browsers, using just a simple SSI call, which will let a user quickly navigate through your website.

In it's current form it's a bit rough and ready, but it works (you can see it in action on grapefruitopia.com if you've got the navigation bar turned on in Mozilla or Opera.

Requirements

SSI enabled web pages that can run cgi/perl scripts.
Has currently only been tested on an Apache server running on Linux.

Installation

unzip the archive, and copy the navgen.lib and navgen.cgi files to your cgi folder (and make sure the navgen.cgi file is set to executable)

Next make a text file (call it map.txt or anything you fancy) and enter the pages in the order that you want the navigation to work

example:

/index.shtml
/somepage.shtml
/someotherpage.shtml
/dir1/index.shtml
/dir1/anotherpage.shtml
/dir2/index.shtml
/dir2/subdir/index.shtml
/lastpage.shtml
Next, open up navgen.cgi and edit the mapfile definition to point to this text file.

Below this is the pagehash which includes extra pages that can be listed in the navigation bar (such as search and copyright pages - uncomment any you want to use and fill in the page details)

  # mapfile is the text file containing the list of all the pages
  # one per line, in the order in which you want the navigation
  # to operate
  my $mapfile = "/home/website/map.txt";

  # add any extra navigation pages to the following hash
  # uncomment a line and set your own page address to use
  my %pagehash = (
                   "search" => "/search.shtml",
                   "author" => "/copyright.shtml",
                   "help" => "/help.shtml",
                   "home" => "http://your.home.page",
                   "bookmark" => "/someinterestingpage.shtml",
                 );
feel free to add as many bookmark entries as you wish!

Including in your pages

Now you need to edit the html of each of your pages in the map, and include navgen, by adding a line like this:
<html><head><title>Your Website</title>
<!--#exec cgi="/cgi-bin/navgen.cgi"-->
</head>
changing the link to point to where you put the .cgi file

And that should be it!

If you want to use it from within your own cgi pages, then just include the navgen.lib file and call the NavGen() subroutine.

Download

Download navgen.tgz v1.0 - 16/07/04

License

Navgen is distributed under the BSD License