wfsp has asked for the wisdom of the Perl Monks concerning the following question:
It is a static web site updated up to 4 times a day. Rebuilding all the site maps every time is easier, in my opinion than trying to update them.
As it stands the body html is built tag by tag and then loaded into a template.
There are four loops each with various conditions (e.g. in the letter menu there is no link to the page you are on).
For me that is a significant amount of logic and I would like all of it to be in the script.
I have looked at HTML::Template and believe that although it could be used I'm afraid it would be very difficult to maintain.
How would other monks approach this task?
------------------------------------ pseudo code ------------------------------------ foreach letter ('a'..'z') make letter menu # for loop 1 make subject menu # for loop 2 foreach subject (subjects){ # for loop 3 make subject header with bookmark foreach article (articles){ # for loop 4 make link to article } } make page } ------------------------------------ pseudo html page ------------------------------------ page a letter menu: a b c d e f etc. (links to other pages) subject menu: afghanistan africa asia etc. (links to subjects on this +page) afghanistan link to article one (newest first) link to article two link to article three etc. africa link to article four link to article five link to article six asia link to article seven link to article eight link to article nine subject menu (as above) letter menu (as above) ------------------------------------ record from database ------------------------------------ u Ukraine 20050122 ../2005/01/22ukraine.html Ukraine: 'Orange Revoluti +on' in Ukraine, 22 January 2005 (fields: letter, subject, date sort key, file, link text)
Updated: clarified pseudo code
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Building html site maps
by CountZero (Bishop) on Jan 30, 2005 at 14:26 UTC | |
Re: Building html site maps
by dimar (Curate) on Jan 30, 2005 at 17:33 UTC | |
by wfsp (Abbot) on Jan 31, 2005 at 18:54 UTC | |
by punkish (Priest) on Jan 31, 2005 at 21:28 UTC | |
by wfsp (Abbot) on Feb 04, 2005 at 19:22 UTC | |
Re: Building html site maps
by punkish (Priest) on Jan 30, 2005 at 15:52 UTC | |
by wfsp (Abbot) on Jan 31, 2005 at 18:45 UTC |