The steps below show how to install the Liferay Theme Generator and generate a theme.
Your first step in generating a theme is installing NodeJS (along with Node Package Manager(npm)) if it’s not already installed. We recommend installing v10.15.1, which is the version Liferay Portal 7.2 supports (See the compatibility matrix). Once NodeJS is installed and you’ve set up your npm environment, you can follow these steps to install the Liferay Theme Generator and generate a theme:
-
Use npm to install the Yeoman dependency:
npm install -g yo
-
Install the Liferay Theme Generator with the command below:
npm install -g generator-liferay-theme
If you’re on Windows, follow the instructions in step 3 to install Sass, otherwise you can skip to step 4.
-
The generator uses node-sass. If you’re on Windows, you must also install node-gyp and Python.
-
Run the generator and follow the prompts to create your theme:
yo liferay-theme
-
Navigate to your theme folder and run
gulp deploy
to deploy your new theme to the server.
Now you have a powerful theme development tool at your disposal. The sky is the limit!