hugulp is a tool to optimize the assets of a Hugo website.
The main idea is to recreate the famous Ruby on Rails Asset Pipeline, which minifies, concatenates and fingerprints the assets used in your website.
This leads to less and smaller network requests to your page, improving overall user experience.
It's internally driven by Gulp.
This project Includes the following tools, tasks and workflows:
Node needs to be installed in your system.
$ npm install -g hugulp
hugulp requires you to create the following folders inside your hugo site:
It will use hugo's default config file: config.toml, but you can specify a different config via the -c, --config switch
$ hugulp build --config config.yaml
$ hugulp watch --config config.yaml
It will do the following:
|In Folder||Looks for||Operation|
|assets/styles||scss, less, css||Convert sass/less to css, then minify the result|
|assets/img||*||Compress changed images|
Note: It searches the folders recursively
hugo will be invoked like this:
$ hugo --config=config.toml -s . -d ./public --buildDrafts=true --verbose=true --baseUrl=""
It runs the same pipeline as the hugulp build command, but hugo is invoked as follows:
$ hugo --config=config.toml -s . -d ./public"
Additionally, files are not watched for changes
Display installed version
Whenever a new hugulp version becomes available, you can update it by running
$ npm update -g hugulp
Pull Requests are welcome 👍.
Made by Juan B. Rodriguez, with a MIT License.