Hello, I am a big fan of Hugo and I am using it for my personal website https://edouard.paris and I am happy with it I want to use Hugo for more projects using external APIs and here is a proposal feature I would like to see implemented (by me or any awesome hugo developer).
I want to use a image resizer engine https://github.com/thoas/picfit. Images are resized dynamically on the first request and then cached. For security an hmac is required. An HMAC is a specific type of message authentication code (MAC) involving a cryptographic hash function and a secret cryptographic key.
<img src="http://myengine.com/display?w=100&h=100&path=path/to/file.png&sig=<hmac>
The new feature would be a new template function hmac with 3 args:
- The hash type (string): md5, sha256
- The message (string)
- The key (string)
Usage:
{{ $key := getenv "KEY"}}
{{ hmac "sha256" "hello, gohugo" $key }}
Please, tell me what do you think of this idea and if I should create a PR.
Thank you