Design Goals
- Clean and simple - the html constructs should be as simple as possible. No javascript or DHTML, unless they are really required.
- Content separated from presentation - quite important for any website. CSS should be used to stylize the pages.
- Easy generation - Only content needs to be written. Every thing else is generated
- Should look good on most browsers including text browsers like lynx and, w3m
- A consistent look
Content generation
With these goals in mind, I developed a set of perl scripts that do
the job. I write a content file and name it say example_c.html.
A perl script will generate the sidebar, header and footer.
The mainpage generation is a little more detailed. Some content is taken from what's new page as well. Say, you have and example file
example_c.html <!--NAV title="An example file" NAV--> Content
Running my script on above file generates this page. A simple
Makefile helps me generate content for all the directories in my website. For
example, this is the Makefile I use for this design directory.
Makefile FILES = index.html example.html all: $(FILES) include inc.mkAll the magic is in the
inc.mk file, which contains the following
rules.
inc.mk
TOPDIR = /w/ppadala/public_html
SCRIPT = $(TOPDIR)/scripts/gen.pl
$(FILES):%.html:%_c.html
$(SCRIPT) $< > $@
chmod go+r $@
clean:
rm -f $(FILES) $(OTHER_FILES)
The whole website is stylized using a single CSS. In the following sections, I will describe a few of the CSS constructs I used in my web site.
Disclaimer: I am not a CSS guru or anything. I learnt by looking at the examples from some excellent sites like Mozilla and CSS Zen.
Main page
The main page contains three columns, header and footer. So, if simplified, the main page contains the following divisions.
<div id="header">
<h1>Pradeep Padala's Home Page</h1>
</div>
<div id="sidebar">
Sidebar list
</div>
<div id="secondcolumn">
Content
</div>
<div id="thirdcolumn">
<div id="whatsnew_box_title">
<h3 style="margin-top: 0;margin-bottom: 0;">What's New</h3>
</div>
<div id="whatsnew_box">
</div>
<div id="createdwith">
</div>
</div>
<div id="footer">
</div>
