gulp-static-php
v0.0.2
Published
A static site generator that uses php to render pages
Downloads
6
Readme
gulp-static-php
A static site generator that uses php to render pages
install
npm install --save gulp-static-php
gulp task
var gulp = require('gulp');
var gulpStaticPhp = require('gulp-static-php');
gulp.task('static-generator', function() {
gulp.src('src/index.php')
.pipe(gulpStaticPhp())
.pipe(gulp.dest('./web'));
});
On first run the plugin will call the php file input in source with the default url index.html simular to the following command line execution
php src/index.php --url=/index.html
afterwards the plugin will crawl the html result for links starting with / to create pages for those as well, and those will call for new pages as well until all the pages are generated.
Inside php additional runtime information can be found in
var_dump($GLOBALS["argv"]);
will result in
array(2) {
[0]=>
string(41) "/project/css-footprint-demo/src/index.php"
[1]=>
string(19) "--url=/index.html"
}