Benjamin Lu

everyday is cool

What Belongs in a Site Template

Retrospective web development exercise for the 2009 archive.

Take two pages from a small site and mark the pieces that repeat. The heading and article usually belong to the individual page. The masthead, navigation, and footer are candidates for a shared template.

Make the change with just two pages. Add a single navigation link to the shared file and verify that it appears in both places. Then check a page in a subdirectory. If its links break, look at how the browser resolves paths from the page URL. The shared template changes where you edit the links, while the page URL still affects where relative links lead.