Created
December 11, 2012 19:40
-
-
Save igorw/4261419 to your computer and use it in GitHub Desktop.
Static Site Generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Amazing static site generator | |
# Works for PHP and HTML sites | |
# Assumes web root to be in /web | |
# Dumps the site into a directory named "static" | |
PORT=9999 | |
php -S localhost:$PORT -t web >/dev/null & | |
PID=$! | |
sleep 0.3 | |
wget --mirror --adjust-extension http://localhost:$PORT | |
kill $PID | |
mv "localhost:$PORT" static |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment