Site Details
Content is being created using simple text files that are processed
with scripts written in Ruby, an object
oriented scripting language, into HTML. This allows me to separate
content (the words and pictures) from presentation (the site look and
feel). This separation allows me to create the site using simple text
files that have minimum HTML code. The presentation layer is captured
in other files that seldom change. All pages have the same look and
feel and can be changed depending on the particular 'needs' of the
site. The two main sites I support are this one and the
the Porsche 912 site. The templates controlling the look
and feel are different for each, but the template processing code is
the same.
Most of the individual page source files are simple. A recent one was
done in support of a question I had on a light
leak asked of the Leica Users Group mailing list. The source file
l23-24.src was:
PRE
[title Light Leak?]
[pix l23-24.jpg]
This is a particularly bad example of a vexing light leak in my M4-2
which may be occurring when changing lenses. Where does it come from?
START
It is all done with templates and the script engine. Templates are
text files of a standard form which have the capability of supporting
text substitution using keywords and standard format phrases. A simple
template might be:
PRE
<HTML><HEAD><TITLE>_TITLE_</TITLE>
<body>
_TEXT_
</body></html>
START
From our file l23-24.src you might guess that the
_TITLE_ and _TEXT_ parameters might be defined as:
| This | Becomes: |
| _TITLE_ | Light Leak? |
| _TEXT_ | [pix l23-24.jpg]
This is a particularly bad example of a vexing light leak in my M4-2
which may be occurring when changing lenses. Where does it come from?
|
Everywhere in the template that _TITLE_ is found, the value
from the source file is substituted. As you can see, the whole
mechanism relies on text substitution. Another substitution is the
the idea of text expansions using a search and replace algorithm. In
the case of our example, [pix l23-24.jpg] is not
HTML and is converted to:
PRE
<center>
<img src='/bw/images/l23-24.jpg' border='2' alt='l23-24.jpg'>
</center>
START
Real Code
As an example here is the main template:
PRE
<HTML><HEAD><TITLE>_TITLE_</TITLE>
<META http-equiv=content-type content=text/html;charset=iso-8859-1>
<include "style.tpl">
</HEAD>
<include "body.tpl">
<include "title.tpl">
<table cellSpacing=0 cellPadding=0 width="100%" border=0 summary=''>
<tr><td align=middle width=130 bgColor=#202020>
</td><td align=right bgColor=#202020>
<include "intro.tpl">
</td></tr><tr>
<td vAlign=top bgColor=#202020>
<include "nav.tpl">
</td> <td valign=top height="978" > <p>
<table cellSpacing=0 cellPadding=0 width="100%" border=0 summary=''>
<tr><td width='10'>
</td><td>
_TEXT_
<p align="right">_DATE_
</td></tr></table>
</td></tr></table>
</body></html>
START
Include files are supported:
PRE
<include "style.tpl">
START
The site is a working test-bed for WEB ideas.
If you want a copy of the scripts, send me an
email. This is not a supported
software product so the scripts may or may not be useful to you.
The ideas are powerful. The implementation is trivial.
Photographs
All photos were processed using PhotoShop running on Windows 2000.
PhotoShop and Microsoft Money are the primary reasons I'm using any
Windows software. The rest of the time, it is all Linux.
Hardware/Software
This site is hosted on an inexpensive ($500) eMachines PC running
RedHat Linux. The DSL connection allows only 128K upload, so it can
not stand much traffic. We currently see about 500 page hits per day
most of which are on the Porsche 912 site. There are
seldom times when pages are being downloaded by more than one client.
Security
Internet access to the machine is screwed down pretty tight to reduce
the number of successful hacker attacks. There was one nearly
successful attack using a known ftp buffer overrun exploit. It
occurred during a two week period of time that the ftp port was
available for my brother to copy some files. It was solved by a
combination of upgrades to ftp and removing access to ftp. We track
and regularly upgrade OS and application security fixes.
-- Dave Hillman
Last modified: Sat, 29-Sep-01 11:07:54 PDT
|