Plywood CNC Test Concept

By Frank Apa October 4, 2002

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)

A white kitten

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.

A white kitten
{
A white kitten

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 }}

A white kitten

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 }}
A white kitten

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 {{ }}

Accessing a predefined variable “foo”:

{{ foo }}

Parameters are separated using spaces

<nav class="recent">
  <h1>Recent Posts</h1>
  <ul>{{range first .Site.Params.SidebarRecentLimit .Site.Recent}}
    <li><a href="{{.RelPermalink}}">{{.Title}}</a></li>
  {{end}}</ul>
</nav>
comments powered by Disqus