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

Generating a Site

laktek edited this page Sep 11, 2012 · 7 revisions

Running the command, punch generate (or punch g) will prepare the full-site in output directory by rendering all pages and copying 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 not 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*",
			        "/*.psd"
		               ]
	}

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.