Skip to content

Instantly share code, notes, and snippets.

@wdalmut
Forked from igorw/build.sh
Created December 11, 2012 22:14
Show Gist options
  • Save wdalmut/4262802 to your computer and use it in GitHub Desktop.
Save wdalmut/4262802 to your computer and use it in GitHub Desktop.
#!/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