PHP keep It Stupid Simple
It's a PHP static page generator, which fits in a tweet
Copy paste the following snippet and put it first in a PHP file. Then view the file in your web browser. It will create a .html file named the same thing as your php file in the same directory, and redirect the user to that html file.
<?php
ob_start(
function($output) {
$t = substr(__FILE__, 0, -4) . '.html';
($f = fopen($t, 'w')) || header("HTTP/1.1 500") && exit(1);
fwrite($f, $output);
header("Location: " . substr($_SERVER['REQUEST_URI'], 0, -4 ) . ".html");
}
);
?>
See example.php
It wouldn't be a static page generator then would it?
Yes it is, but it works and solves my problem while the minimal amount of complexity.