Percent Substitution

H
T files automatically undergo percent-substitution (also known as URL-substitution) against a library of URLs. That means that strings like %(sect:info)s or %(person:dustin)s automatically get turned into URLs by the time the file makes it to a web browser. The important parts are the initial percent-parenthesis %( and the final parenthesis-s )s. What comes in between is a command, or key, to the URL substitution library. There are many percent-substitution keys, but the most common keys in HT files are:

wwwroot
The base URL of the current server, e.g., http://www.cs.uchicago.edu.
sect:blah
The URL of [section] blah. For example, %(sect:events)s generates http://www.cs.uchicago.edu/events, the URL for the Events section.
person:foo
The URL of the person page for the person with login foo. For example, %(person:dustin)s generates http://www.cs.uchicago.edu/people/dustin, the URL for Dustin's person page.

The URLs generated by these keys can be extended easily like this: %(sect:info)s/services translates to the URL of the computing services page, which is the URL for the Info section followed by a slash and 'services'. Alternately, this can be written %(/info/services)s, where the initial slash starts at %(wwwroot)s automatically.

It's important to use percent-substitution, because it ensures that the URLs turn out right for the user whether she's logged in or logged out, and whether she's using the main virtual host or a development virtual host. It also allows programmers to change URLs later, and be sure that everything still points in the right direction.