With release 0.10.0 now on Github, Swiftfire has made probably the most important step in it is lifetime.

Code injection into prefab HTML and CSS files!

This powerfull feature is best explained by a simple example: Suppose you have a static website and want to insert a hit-counter, showing the number of times a page has been requested. For this purpose a function was written, called nofPageHits. This functions was properly registered at boot time.

In the HTML page it is includes as follows:

<p>This page was requested .nofPageHits() times</p>

which after parsing by Swiftfire becomes:

<p>This page was requested 38755 times</p>

and is subsequently served to the requesting client.

Simple yet powerfull.

With this feature it becomes possible to develop an entire website in Swift, HTML and CSS. No other tools, languages or third party extensions necessary. Though they can of course be used.

To trigger the parsing step, rename a file to include the four characters: “.sf.”.

For example index.html would become index.sf.html.

Of course index.sf.html will be returned as the default landing page if there is no index.html present.

For more information check out the updated manual, especially functions.