Skip to content

Instantly share code, notes, and snippets.

@briehanlombaard
Created April 9, 2014 14:31
Show Gist options
  • Select an option

  • Save briehanlombaard/10277211 to your computer and use it in GitHub Desktop.

Select an option

Save briehanlombaard/10277211 to your computer and use it in GitHub Desktop.
#!/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