The assets folder structure of a Theme includes:
All folders and files in the public
directory will be published when you run command:
By default, file public/images/screenshot.png
will be displayed as a Theme thumbnail in the admin interface admin-cp/themes
.
You can use the theme_asset()
function to get the url to your asset file.
E.x:
If you want to get the assets of a specific Theme, add the Theme name to the 2nd param:
Laravel Mix provides a clean, fluent API for defining basic webpack build steps for your applications. Mix supports several common CSS and JavaScript pre-processors. In Juzaweb CMS you can easily use them in each of your themes.
The file assets/mix.js
will be the webpack file for your theme, instead of webpack.mix.js
in the root folder. See the example below:
The script above will mix and minify two files styles.css
and script.js
to form css/styles.min.css
and js/script.min.js
files in public folder. To execute them, run command:
* Don't forget run yarn install
to download the packages before mix them
See more documentation Laravel Mix here.