Passing a variable to replace function

Since there seems to be no support of internationalization for the date format, I’d like to use the replace function instead.

But I can’t find the right syntax to this:

<h2 class="subtitle is-6">{{ replace {{ .Date.Format "2 January 2006" }} "December" "Décembre" }}</h2>

error: unexpected “{” in operand
Is there a way to use replace with a the date parameter ? Even if it’s not a perfect solution because I’ll have to use it 12 times…

Thanks !

Your approach looks good but nesting curly-braces isn’t valid syntax. Rather try this:

<h2 class="subtitle is-6">{{ replace (.Date.Format "2 January 2006") "December"  "Décembre" }}</h2>

But you could also have a look at this workaround by @RickCogley

It worked perfectly with the config file in data + the index function. Thanks a lot :slight_smile: