---
---
{{/* base64 */}}
{{"https://gohugo.io/functions/base64" | markdownify }}
{{ "Hello world"      | base64Encode }}
{{ "SGVsbG8gd29ybGQ=" | base64Decode }}

{{ "Hello world"| base64Encode | base64Decode }}
{{ $myTest := (42 | base64Encode | base64Decode) }}   {{/* result is a string */}}
{{ printf "%+v (T:%T #v:%#v)" $myTest $myTest $myTest }}

{{"https://gohugo.io/functions/base64#base64-with-apis" | markdownify }}

{{- if .Site.Params.enablegetJSON }}
  {{ $resp := getJSON "https://api.github.com/repos/it-gro/HugoTemplatingPlayground/readme"  }}
  {{ $resp.content | base64Decode | markdownify }}
{{- end }}


https://gohugo.io/functions/base64
SGVsbG8gd29ybGQ=
Hello world

Hello world
   
42 (T:string #v:"42")

https://gohugo.io/functions/base64#base64-with-apis
  
  

Hugo Templates Code Playground

This is a Playground for Hugo Templates Coding Hugo.

GitHub Page: https://it-gro.github.io/HugoTemplateCodePlyGnd

Playground is for

  • Syntax: Literals, Comments, Text and Spaces, Datatypes, Variables, Arguments, Conditions, Range, With
  • Functions
  • Variables
  • Shortcodes

but not for

  • any html, css, js stuff
  • hugo template lookup order

How to start:

git clone https://github.com/it-gro/HugoTemplateCodePlyGnd.git
cd HugoTemplateCodePlyGnd
hugo -v -w server --disableFastRender --navigateToChanged --config config.toml,config.local.toml

http://localhost:1313