Reputation: 1107
I'm making website templates where the final product will be static HTML files.
What I'm looking for is something in PHP (or maybe Ruby) that will allow me to develop the pages in that language and then output the files to HTML (with the right structure and names) in a click or command.
Upvotes: 1
Views: 177
Reputation: 953
You need static site generator.
Some examples:
Upvotes: 2
Reputation: 92752
You want wget :) No, really: make the site in whatever dynamic language you use, and then mirror it with wget - you'll get a complete static version of your site:
wget -k -r --restrict-file-names=windows http://www.example.com/
which -r
ecursively downloads the site,
-k
onverts the links,
and avoids the use of ?
and similar "special" characters in the filenames
This will get you a completely static version of your site - note that you want to keep the dynamic version around, in case you need to make changes: then you need to do this conversion again (editing the static version is a major PITA).
Upvotes: 2
Reputation: 15241
Buffer the output, and have a naming scheme for your pages. PHP has functions which let you buffer to a variable which can then be saved - ob_start().
Upvotes: 0
Reputation:
I think what you may want for PHP based solution is the smarty templating engine.. http://www.smarty.net/.
A ruby on rails solution would be to use thoughtbot's high voltage rails plugin https://github.com/thoughtbot/high_voltage
Upvotes: 1