Files
Luc Perkins c6dd35ba51 Update to Hugo 0.53 and remove all .Site references (#12079)
* Remove all .Site variable references

* Update Hugo version in Travis CI config and Makefile
2019-02-05 08:33:23 -08:00

20 lines
681 B
HTML

{{ if .Parent }}
{{ $name := trim (.Get "name") " " }}
{{ $include := trim (.Get "include") " "}}
{{ $codelang := .Get "codelang" }}
{{ if not (.Parent.Scratch.Get "tabs") }}
{{ .Parent.Scratch.Set "tabs" slice }}
{{ end }}
{{ with .Inner }}
{{ if $codelang }}
{{ $.Parent.Scratch.Add "tabs" (dict "name" $name "content" (highlight . $codelang "") ) }}
{{ else }}
{{ $.Parent.Scratch.Add "tabs" (dict "name" $name "content" . ) }}
{{ end }}
{{ else }}
{{ $.Parent.Scratch.Add "tabs" (dict "name" $name "include" $include "codelang" $codelang) }}
{{ end }}
{{ else }}
{{- errorf "[%s] %q: tab shortcode missing its parent" site.Language.Lang .Page.Path -}}
{{ end}}