Skip to content

Alnitak-NL/gulp-static-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

gulp-static-php npm version

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"
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published