Wednesday, July 05, 2006

Embedded scripting in HTML pages

I finally put two and two together, and integrated Alex Chapman's contrib/embedded.factor with the HTTP server. Now when serving any file with the .fhtml suffix, the HTTP server preprocesses it to evaluate blocks of Factor code delimited by <% and %>.

You can include other pages relative to the document root of the current site by calling include-page:
<% "templates/foo.html" include-page %>

Don't forget to put this near the top of your .fhtml file though:
<% USE: file-responder %>

No comments: