Created
April 9, 2014 14:31
-
-
Save briehanlombaard/10277211 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #!/usr/bin/env php | |
| <?php | |
| /** | |
| * A simple static site generator useful for prototyping. | |
| * | |
| * Example: | |
| * | |
| * layout.php | |
| * | |
| * <body><?php require($page); ?></body> | |
| * | |
| * index.php | |
| * | |
| * <h1>Hello, World.</h1> | |
| * | |
| * Execute the build script with your index.php page as argument to build the | |
| * page: | |
| * | |
| * $ php build.php index.php | |
| * <body><h1>Hello, World.</h1></body> | |
| */ | |
| $pages = array_slice($argv, 1); | |
| foreach($pages as $page) { | |
| require('layout.php'); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment