There was at least a beta version of Template Toolkit done in php. But the original in perl is essentially a different language. It's quite powerful.
The original is on CPAN. The current version is 2.25, I think.
My web building system has content and markup almost totally separated.
This is the basic page before content addition:
[% PROCESS header.inc
Title = "Sherwood's Forests -- Seedling Sales"
Desc = "Sherwood's Forests Pre-season orders for little Trees."
%]
<DIV id="content">
[% FILTER multimarkdown %]
# Seedling Sales 2014
<div markdown="1" class=picr>
![Picture alternate text][/base-absolute/path/to/image.jpg]
</div>
Please be patient
#### This file is still germinating
[% PROCESS Copyright.inc %][% END %]
</div>
[% INCLUDE footer.inc %]
All content goes between the FILTER line and the bottom Content is written in markdown. allows me to float an image on the right side of column. The CSS is entirely liquid so the screen is still usable (barely) on a iPhone.
Most of the magic is in header.inc. It reads a the file, fileindex.txt which is in essence the menu tree for the entire website. No java. All static web sites.
Fileindex.text looks like this:
ABBAB:f:/Home/Business_Stuff/Inventory.html:3:Inventory.html:Inventory
ABCAB:f:/Home/Business_Stuff/Ordering.html:3:Ordering.html:Ordering
ABDAB:f:/Home/Business_Stuff/Prices.html:3:Prices.html:Prices
ABJAB:f:/Home/Business_Stuff/Business_Stuff.html:3:Business_Stuff.html:Business Stuff
ADAAA:d:/Home/Services:2:Services:Services
ADJAB:f:/Home/Services/Christmas_Trees.html:3:Christmas_Trees.html:Christmas Trees
ADKAB:f:/Home/Services/Custom_Growing.html:3:Custom_Growing.html:Custom Growing
ADLAB:f:/Home/Services/Nature_Walks.html:3:Nature_Walks.html:Nature Walks
The alphabet soup at the beginning determines the sort order for the index. d or f is directory or file. The number is the number of levels down in the menu hierarchy it is. Then file component of the full path. Finally the text used for the link name. Some of this is redundent from earlier rewrites, but it wasn't worth fixing. "Don't optimize it yet". The last field allows having a different link name than the file name. This isn't used much.
fileindex.txt itself is generated by a perl program MakeFileIndex. It uses two sources of information: the results of find . run on the source tree, and a file tt2seq which has optional overrides on the order of menu items.
I want to add a new page to my site.
Copy the first file to the appropriate directory. Change the contents of that file with my new content. If it needs to appear in other than non-alphabetic order, then I have to add lines to tt2seq to control that. Run MakeFileIndex. Run ttree -a (a utility in Template Toolkit) This updates all the menu items in every file.
Verify that the page looks like I want. If not, then re-edit. Rerun ttree for the file I just edited. When I'm happy, sync to my server.
The net effect is that the amount of time I spend with the mechanics is tiny compared to the time it takes to write.
If I decide to re-arrange the site, I just move files around the directory tree, and rebuild. This does NOT fix any internal links in the content blocks.
The site produced this way is http://sherwoods-forests.com. It's an old fashioned site. The emphasis is on content, not on sizzle. But it's a good system for producing static pages.