Reputation: 2000
I am looking for a solution that works with hugo server
command. I am aware that I could create an additional .css file inside static/css
directory and have it merged into the public directory with hugo
command, however that does not work with hugo server
unfortunately.
Thanks in advance.
Upvotes: 2
Views: 2431
Reputation: 1324787
On Hugo Pipes, you have an example with "Hugo Pipes Revolution -- A Hugo built-in asset pipeline" from Regis Philibert to give some examples.
From now on, Hugo will take care of bundling, minifying, fingerprinting our assets and even compiling our sass files! All of this without any external build tools.
So it works with hugo server
.
You can define your method in assets
:
These methods will only be available on files living in the
assets
directory: think of it as astatic
directory except the files will not be published by default.Much like its static counterpart:
- Its location is configurable with the
assetDir
key of yourconfig.yaml
. (will default toassets
)- It follows the Hugo’s file unison logic.
Meaning, anything in yourproject/assets
will override homonymous files of yourtheme/assets
.
From there, you can adapt one of the sass centering techniques to apply it automatically on your images using pipes.
See "Centering With Sass".
Upvotes: 1