Just discovered that when you put your .htaccess in layouts and name it htacess (so not dot) you can use Variables like {{ .Site.BaseUrl }} for your redirects etc. It will be automatically generated as .htaccess.
Same works for humans.txt. Just put the file in the layouts folder, use Variables and generate the site. Here’s an example of humans.txt:
/* TEAM */
Owner and author: {{ .Site.owner.name }}
Contact: {{ .Site.BaseURL }}contact/
Twitter: {{ .Site.Params.social.twitter }}
/* THANKS */
Software used:
/* SITE */
Language: German
Standards: HTML5, CSS3, JavaScript
Made with: Hugo - https://gohugo.io/
I’m very sorry, guys, but this is not happening. I fooled myself because I still had humans.txt and .htaccess in my static directory. Sorry for the confusion.
To the development team: This could be a nice addition. I use Hugo projects as frameworks for customer projects and in case this would work I could just type the name of the customer in config.toml and Hugo would create the correct data in .htaccess and humans.txt. This is working already with robots.txt.
I tried to flag this post just now, but marked it incorrectly, so instead I’ll just make a note here, to the @moderators.
I was gonna nominate this post to be deleted or moved to #feature. It comes up in the early results for “htaccess” searches. This is a “community gardening” recommendation.
If the mods are uncomfortable deleting messages, know:
It is a soft-delete system, and
you can make it a private message instead and that works.