About This Site
|Public Links||Personal Links|
I am the primary user (frequently the only) user of this site. My goal was for this to be my home on the web. As such it is:
- my bookmarks
- my reference library
- my digital closet
- my notebook
- my diary
- my presence.
In designing the structure of the site, I have two main interests. First, I want the site to be easily navigable; I visit it every day. Second, I want the site to be easy to update; I have more ideas than time. To make it easy to navigate I developed a navagational placard with the metaphor being the directional placards you find near an elevator in a building or in the hall of a museum. The contents of such placards are context sensitive; lots of detail about the local environment and more general directions to more distant destinations. So the placard near the top of this page is the top level version. It shows just the major sections of the site. If you go to a specific section (such as the personal) you will see the top level information plus the section specific links. An example appears to the right of this paragraph below this paragraph.
|Public Links||Personal Links
This has made the site very easy for me to navigate; and the navigation strategy is scalable in that as sections grow and develop subsections the navigation placard still makes the whole site a click or two away without becoming an unmanageable sidebar. The placard is implemented as a table with cells for sections and sub-tables for section navigation links. Unfortunately, the first implementation of the placard made the site difficult to update. If I added a new section every page had to be modified; and each section had a unique version of the placard definition.
Starting with version 3.0 of the site, every page is developed as an macro definition written in GNU m4. This has had several benefits but the major one is that the placard is specified for each page with the single line:
INSERT_PLACARD(section-name). In fact, the second placard on this page was generated by adding the line:
INSERT_PLACARD(personal)to the page.
The macros that generate the placard have a couple of interesting features; interesting to me at least. First,a link in a placard will vary depending on which section the page is in and which section is the target of the link. This allowed me to represent the links in the placard as relative URLs relative URL indicates the target relative to the linking document. The site is organized a collection of directories; where each directory contains the pages for a single section of the host. The toplevel directory is the homepage section. By using relative URLs, the same pages can be located on the public hosting site www.hirstlogics.net or on a local test machine without public access. In order for the same definition to generate placards for any section, it must be able to generate specialized URLs for different sections. The two macros that are primarily responsible for generating specialized URLs are:
GOTO_FROMdefined as follows:
dnl---------------------------------------------------- define(LOCAL, `ifelse($1,homepage,HOME,$1,$2,IN,OUT)')dnl dnl-------------------------------------------------- dnl--- GOTO_FROM(dir1,dir2) generates appr url dnl--- to create link from dir1 to dir2s index define(GOTO_FROM,`dnl ifelse(LOCAL($2,$1),HOME,$1/index.html, LOCAL($2,$1),IN,index.html,../$1/index.html)'dnl )dnl
LOCALmacro maps the relationship between of sections into one of three values: (1) to get to the homepage section to any section is HOME, (2) to get a page in any section to the a page in the same section is IN and (3) to get to a page in one section from another section is OUT.
GOTO_FROMmacro uses the
LOCALmacro to generate a link from a page in any section to the index.html page of any section. If the current section is the homepage section and the target is a section named section-x then the link is section-x/index.html If the target section is another section named section-x the link is: ../section-x/index.html. And, if the target is the homepage section the link is always: ../index.html. So the following lines:
GOTO_FROM(public,homepage) GOTO_FROM(public,public) GOTO_FROM(public,personal)
generate the following output:
public/index.html index.html ../public/index.html
These macros plus the ability to conditionally include subtables completes the definition of the
PLACARDmacro. The following is a simplified example of the placard macro:
define(`MINI_PLACARD', `<table> <tr> <td> <a href="GOTO_FROM(public,$1)">Public Links</a> ifelse($1,public, <table> <tr> item-1 </tr> <tr> item-2 </tr> <tr> item-3 </tr> </table> )dnl </td> <td> <a href="GOTO_FROM(personal,$1)>Private Links</a></td> </tr> </table>')
Using this definition, this statement:
MINI_PLACARD(public) generates the following code:
<table> <tr> <td> <a href="index.html">Public Links</a> <table> <tr> item-1 </tr> <tr> item-2 </tr> <tr> item-3 </tr> </table> </td> <td> <a href="../personal/index.html>Private Links</a></td> </tr> </table>
But the statement:
MINI_PLACARD(personal) generates the following code:
<table> <tr> <td> <a href="../public/index.html">Public Links</a> </td> <td> <a href="index.html>Private Links</a></td> </tr> </table>