Being the resident computer geek in local charitable organisation, I have been, well, volunteered to maintain our web site. It's really quite a trivial undertaking, nothing fancy, because we're not even paying for a regular site or anything. We're just using the space afforded by my ISP - which does not, to my knowledge, allow for CGI of any sort. This is not a huge deal because there is no (current) need for forms or anything. Just that the content changes from time to time, and I'd like to generate the content as much as possible.
So what I've done in the past is to create an HTML template (yes, using HTML::Template) for the header, the footer, and then the content of each page. The content for each page is based on a number of CSVs (which I use DBD::CSV for) which I pull together as-needed. Then I would run another perl script to upload, via FTP, to the ISP's site. And it works. More or less.
On sites where I can use CGI, I just throw in CGI::Application, inherit from there, and I'm basically done. Here, I need some way to loop through all runmodes, grab the output from each, and upload them (along with any new non-generated data, such as PDFs, CSS, or other images).
What I have is more or less working. However, I'm wondering if any other monks have a better idea on how to handle this:
- Generate static pages "at will" (e.g., via cron job, or just when I run the command).
- Each page has different logic behind it.
- As much as possible, I'd like the whole thing to work as-is in a CGI environment as in a generated-static environment. That way, I can use a local webserver, point it to my local setup, and test changes in my browser(s) immediately. Edit, save, reload.
I'm thinking to throw in some
XML::Twig into the mix here during static-generation to change any href's from "index.cgi?rm=*foo*" to "*foo*.html" to help with the "working as-is in both environments". Mind you, if someone has a better idea, I figure I should ask now before I go ahead and write anything :-)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.