Family and food go hand in hand here, so designing and making my own kitchen table
was something I always wanted to do. I won’t eveer forget my eldest boy as a little boy
in teething pain, chomp down on the side of the table. I did’nt feel bad, knowing what I did.
This document is a brief primer on using go templates. The go docs
provide more details.
Go templates provide an extremely simple template language. It adheres to the
belief that only the most basic of logic belongs in the template or view layer.
One consequence of this simplicity is that go templates parse very quickly.
A unique characteristic of go templates is they are content aware. Variables and
content will be sanitized depending on the context of where they are used. More
details can be found in the go docs.
Basic Syntax
[DUCKDUCKGO](https://duckduckgo.com)
Go lang templates are html files with the addition of variables and
functions.
"It may be ugly, but the tolerances are tight"
The detail oriented of you might notice that I’ve clamped down a mechanical pencil with .5 mm graphite lead. They don’t break even though I may not be using the most sophisticated lead screw. posuere eu lorem.
{
Functions
ns](/layout/functions) provide some additional functionality we believe
are useful for building websites. Functions are called by using their name
followed by the required parameters separated by spaces. Template
functions cannot be added without recompiling hugo.
Example:
{{ add 1 2 }}
Functions
Go template ship with a few functions which provide basic functionality. The go
template system also provides a mechanism for applications to extend the
available functions with their own. Hugo template
functions provide some additional functionality we believe
are useful for building websites. Functions are called by using their name
followed by the required parameters separated by spaces. Template
functions cannot be added without recompiling hugo.
Example:
{{ add 1 2 }}
Functions
Go template ship with a few functions which provide basic functionality. The go
template system also provides a mechanism for applications to extend the
available functions with their own. Hugo template
functions provide some additional functionality we believe
are useful for building websites. Functions are called by using their name
followed by the required parameters separated by spaces. Template
functions cannot be added without recompiling hugo.
Example:
Go variables and functions are accessible within {{ }}