Skip to content
This repository has been archived by the owner on Nov 27, 2018. It is now read-only.

Generating a Site

Lakshan Perera edited this page Sep 10, 2012 · 7 revisions

The punch generate (or punch g) command will create the full site in the output directory (by rendering all pages and preparing assets).

If you're using punch publish command to publish your site, it will automatically generate the site before publishing.

Forcing a Full-Site Generation

By default, Punch will generate the existing files (in output directory) if they are not modified. However, if you want to force a full generation, run the generate command with --blank option.

	punch g --blank

You can set this option from the configuration (config.json) as well.

	"generator" : {
		"blank" : true
	}

How to skip paths

Sometimes, you may need to exclude certain paths from generation. For example, if you are using LESS's import feature, you may not want to compile the individual LESS files to CSS. On such instances, you can instruct Punch to skip those paths from generation.

	"generator" : {
		"skip_paths" : [ 
											"/assets/less*",
											"/assets/mocks/*
									 ]
	}

Note, that you can use regular expressions to match the paths.

Generator Hooks

You can also specify hooks to run after generating each file and the site. Writing Generator Hooks section will provide more details on the topic.