Liferay Workspace reserves the
themes folder only for themes that are created
with the Themes Generator. There are no Blade CLI-provided commands or Maven
archetypes to generate a theme for this folder. You must leverage the
Liferay Theme Generator
from within the
themes folder to create them; you can also copy a generated
theme into the folder.
You’ll demo this theme management capability next. Be sure the Liferay Theme Generator’s required tooling is installed.
Navigate to your workspace’s
themesfolder and run the following command:
Follow the prompts to create your theme.
Navigate into your new theme and run
Liferay Workspace builds the front-end theme using Gradle. Under the hood, Liferay’s Node Gradle Plugin is applied and used to build your theme.
Workspace is smart enough to differentiate between theme types. For instance, you can’t copy a theme built with the Theme Generator into the
warsfolder and expect it to build. You can test if your project is recognized by workspace by running this command from workspace’s root folder:
Your CLI should display your new theme under the
Root project 'liferay-workspace' +--- Project ':themes' | \--- Project ':themes:my-generated-theme'
If you moved a WAR-style theme (Gradle/Maven-based) into the
themesfolder, it is not recognized by the Gradle
Excellent! You learned how generated themes are recognized in workspace and where they should reside. For more information on building Gradle/Maven-based themes in workspace, see its dedicated article.