{{.SiteTitle}}
22 helpers registered
across 6 groups
{{capitalize $first.Title}}
input: "{{$first.Title}}"
{{$first.Excerpt | truncate 80}}
capped at 80 chars
{{prepend $first.Slug "/articles/"}}
prepended "/articles/" to slug
{{strAppend $first.Slug ".html"}}
appended ".html" to slug
{{join $parts " · "}}
split on "," then joined with " · "
{{fmtNumber $first.Views}}
raw value: {{$first.Views}}
$ {{fmtNumber $paid.Price}}
raw value: {{$paid.Price}}
{{fmtDate $first.PublishedAt "short"}}
layout: "02 Jan 2006"
{{fmtDate $first.PublishedAt "long"}}
layout: "02 January 2006"
{{fmtDate $first.PublishedAt "iso"}}
layout: "2006-01-02"
{{timeAgo .PublishedAt}} — {{fmtDate .PublishedAt "short"}}
{{end}}{{capitalize .Title}}
first article in the list
{{end}}{{capitalize .Title}}
last article in the list
{{end}}— {{capitalize .Title}}
{{end}}only first 2 of {{len .Articles}} articles
✓ has tag "go"
{{else}}✗ missing tag "go"
{{end}}tags: {{join $first.Tags ", "}}
✓ excerpt mentions "FuncMap"
{{else}}✗ not found
{{end}}substring search on .Excerpt
{{join $first.Tags " / "}}
tags joined with " / "
| Helper | Article | Input | Output |
|---|---|---|---|
| defaultVal | {{.Title | capitalize | truncate 30}} | .Subtitle ({{if .Subtitle}}"{{.Subtitle}}"{{else}}empty{{end}}) | {{defaultVal "No subtitle" .Subtitle}} |
| ternary | {{capitalize .Title | truncate 30}} | .Featured = {{.Featured}} | {{ternary "⭐ featured" "regular" .Featured}} |
| coalesce | {{capitalize .Title | truncate 30}} | .Subtitle → .Title | {{coalesce .Subtitle .Title}} |
{{.}}
{{end}}{{.Excerpt | truncate 160}}
{{prepend .Slug "/articles/"}} →