This trial repository was created to see in which order Hugo processes the content.
The reason is that I would like to add some Scratch
data to every page before the pages
are rendered. Since Hugo does most of the processing in parallel this is not so trivial.
In this repo I tried four ways to run the partial which adds the Scratch
data:
weight
set such that it will be processed first.The selection takes place in config.yaml
:
params:
# scratchProcessing: # homeLayout / homeCustomOutput / perLayout / customLayout
# Process the partial for adding some Scratch data to the page:
# "homeLayout" - using a loop in the home layout (`/index.html`)
# "homeCustomOutput" - using a loop in the home custom output layout (`/index.custom-output.html`)
# "perLayout" - as the page is processed by its corresponding layout (`_default/single.html` etc.)
# "customLayout" - using a loop in a custom layout (`_default/custom-layout.html`)
scratchProcessing: customLayout
To inspect the order a number (or time stamp) is added to the scratch.