Chapter 22: Publishing
22.14. Website templates

Web pages are very idiosyncratic things and Inform will almost certainly not produce exactly what we want. What it actually does is to take an existing "template" web page, and paste in the relevant information to make the final product. So by starting with a different template, we can end up with an entirely different-looking web page: like this one, for instance -

The template ordinarily used by Inform is called "Standard" and comes built in. Any others we must provide ourselves, creating them with any of the many HTML-editing programs in the world. Suppose we write:

Release along with cover art, a "Platinum" website, a file of "Collegio magazine" called "Collegio.pdf" and a file of "The mating call of the green wyvern" called "Mating Wyverns.mp3".

This is identical to the previous version except for the "Platinum": note the quotation marks. Inform does not have a template called "Platinum" built in, so it looks for one in the user's folder of Inform extensions (about which, more in the next chapter). Under Mac OS X, Inform will look for the template file as:

~/Library/Inform/Templates/Platinum.html

where "~" is the user's home folder. Under Windows, Inform will look for:

My Documents\Inform\Templates\Platinum.html

When it turns the template into the final web page, what Inform does is to replace certain capitalised words in square brackets with the appropriate text:

[TITLE] becomes the story title
[AUTHOR] becomes the author's name
[YEAR] becomes the story creation year
[BLURB] becomes the story description
[RELEASE] becomes the release number
[COVER] becomes the cover art (the small 120x120 cover image)
[DOWNLOAD] becomes the download link
[AUXILIARY] becomes the list of feelie-like files, if any
[IFID] becomes the IFID

Everything else is left alone. This means we can simply lift a page from an existing website, stick in the appropriate square-bracketed text in the right places, and use that as a template. Perhaps this will still not be ideal, but it will probably get a lot nearer to what we want.


PreviousContentsNext