Advanced #
Using Data #
Through using templates Hugo can build page content from datafiles. This is particularly useful for when you want to display structured data in a page and when it would be easier to maintain a datafile rather than a Markdown or HTML document.
Creating Shortcodes #
It is possible to create your own shortcodes.
These should be placed in layouts/shortcodes/
.
If you feel the need to use HTML or want to create page content from a datafile (like a YAML file or csv) then a shortcode is probably the right answer.
You should refer to Hugo’s templates and functions documentation for resources to help writing a shortcode.
Partial Templates #
Whole page templates are built from of a number of smaller partial templates. This approach reduces repeated code in templates and help keep making changes simple.
The theme defines a number of dummy partial templates for us to overwrite.
For example, the Creative Commons notice at the bottom of each page was added by editing layouts/partial/docs/inject/footer.html
.