Front Matter false, False, FALSE and FAlse

I’m aware that in front matter we just have strings - no real boolen.
There is probably a kind of “type casting” involved.
Edit: see: Boolean Language-Independent Type for YAML™ Version 1.1

We have: Templating | Hugo

Go Templates treat the following values as false:
any zero-length array, slice, map, or string

Given in front matter

foo: false

leads to boolen false. False as well - and also FALSE.
But not
FAlse (FALse, FALSe, fAlse, …)
So there is no “lower” involved.

Is this intentionally done?
Looks like FAlse is converted into a string “FAlse” which is, being no-zero-length, true.

Hugo Static Site Generator v0.33 linux/amd64 BuildDate: 

That is not true (pun intended).

YAML, TOML and JSON all supports boolean values:

bepIsSmart = true

The above is truthful in more than one way (pun intended).

1 Like

true in the file is stored as (hex)

What do you mean by “stored as”? Are you looking at the raw memory dump?

I was referring to true and false in front matter and my statement: “no real boolean”.

iMustBe: "a fool"

=> I get a String

iMustBe: false
{ if .Params.iMustBe }} => evaluates to false
iMustBe: FAlse

=> evaluates to true

(FALse gets converted into a String, non empty => true)

But hej - now I saw:


These are defined boolean values - I just missed those one’s :roll_eyes: )

And after seeing:

This tag accepts all scalar values. It is is typically used as the fall-back tag for scalar nodes.

The magic is gone and all clear…