Skip to content

Instantly share code, notes, and snippets.

@igorw
Created December 11, 2012 19:40
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save igorw/4261419 to your computer and use it in GitHub Desktop.
Save igorw/4261419 to your computer and use it in GitHub Desktop.
Static Site Generator
#!/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