Been trying to implement custom templates on my gitea installation for a while. I am using the docker implementation.
I have checked the gitea documentation on templating and configuration, but the documentation is honestly pretty vague.
The last indication from @lafriks suggests the following:
As for custom folder it specified in
GITEA_CUSTOM
variable or by default it is$GITEA_WORK_DIR/custom
Custom templates need to be placed in
$GITEA_CUSTOM/custom/templates/custom/
directory
However, there is no information under the documentation as to what category the GITEA_CUSTOM
variable goes under. I added it under the [ui]
and then at the top (no category), to no avail.
The desired value for GITEA_CUSTOM
is /data/gitea/custom
(in docker, I am assuming the $GITEA_WORK_DIR
resolves to /data/gitea
, but even this I don’t know for sure. The app.ini file says that APP_DATA_PATH
resolves /data/gitea
).
Interestingly enough, printenv
inside the container has no mention of GITEA_WORK_DIR
, but it shows GITEA_CUSTOM
as /data/gitea
As such, I have put my template files in the following places, hoping that at least one of the locations would get picked up:
/data/gitea/custom/templates/custom/header.tmpl
/data/gitea/custom/templates/header.tmpl
/data/gitea/custom/header.tmpl
/data/gitea/templates/custom/header.tmpl
/data/gitea/templates/header.tmpl
All of the files have a single value: <!-- this is a test to see if it is picked up by gitea -->
.
I do take care of taking down the docker container and restarting it (something that I have seen mentioned).
However, when looking at the html source of the gitea app, the code introduced in my template is nowhere to be found. I have cleared browser cache, logged out, logged back in, to no avail.
Thanks in advance to anyone who has made this work and has some info on how this is supposed to go.