3 ms·
It's called PHP and you can host it anywhere, or if there's nothing dynamic going on, run it on the files on your computer and upload the generated HTML/CSS/JS
by optymizer 3y ago
It's called PHP and you can host it anywhere, or if there's nothing dynamic going on, run it on the files on your computer and upload the generated HTML/CSS/JS files to an S3 bucket.
src/index.php
---------
<!DOCTYPE html>
<html>
<head><title>Hey look ma, we're back to PHP</title></head>
<body>
<? include "navbar.php" ?>
<p>Don't forget about PHP - a hypertext preprocessor!</p>
<? include footer.php ?>
</body>
</html>
src/navbar.php
----------
<div>
<ul>
<li>Home</li>
<li>About</li>
</ul>
</div>
Makefile to generate a static site:
-----------------------------------
dist/index.html: src/index.php
dist/about.html: src/about.php
dist/%.html: src/%.php
@mkdir -p ${dir $@}
php $< > $@