How to customize the URL path structure?
Some changes I’d like to make:
Remove the word
branch from the URL. Such as in the current path structure:
I could not find anything in the documentation mentioning it.
Move the word
raw to be a subdomain, and become something like:
I know this is possible via a proxy, but I’m wondering if I can do it directly on Gitea.
May 6, 2023, 4:06am
Sometimes, a tag can have the same name with a branch. That’s why we have a prefix before branch_name.
For the second, it really belongs to a reverse proxy reponsibility.
May 6, 2023, 9:29pm
If you are very intent on doing this without reverse proxy, you could modify Gitea and compile your own binary.
You can change routes in this file
gitea/web.go at main · go-gitea/gitea · GitHub. You will have to make the relevant modifications to templates as well. Note that this change is probably not ideal like lunny mentioned.
The raw link can be amended in the template, or modify the raw route to redirect to the raw domain in the code. Most maintainable would be to change the template, since you can provide official Gitea binary with custom templates.