Issue with templates in archetype

I’m trying to set the slug to a string of length 6 using the following.

  1. Get a hmac string.
  2. From the string, get the prefix of length 6.
---
slug: {{ substr {{ hmac "sha256" "<random-string>" .Path }} 0 6 }}
---

Apparently this syntax is wrong. How can this be fixed?

Braces surround the action; use parentheses within.

{{ substr (hmac "sha256" "<random-string>" .Path ) 0 6 }}
1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.