O'Reilly logo

Learning Yeoman by Jonathan Spratley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The new custom subgenerator

Let's create a subgenerator for the custom generator we just created; this subgenerator is going to simply create a new page in the project and add a link to the page defined in the projects app/index.html file.

To create a new subgenerator, open a terminal and make the generator we created before the current working directory and execute the following command:

$ yo generator:subgenerator page

The preceding command will invoke the generator:subgenerator command, which then scaffolds a subgenerator module definition file and a template in the root of the generator project.

Understanding the subgenerator's directory structure

The directory structure created is relatively simple; it consists of a folder named after the subgenerator, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required