Customizing Gitea
If Gitea is deployed from binary, all default paths will be relative to the giteabinary. If installed from a distribution, these paths will likely be modified tothe Linux Filesystem Standard. Gitea will create required folders, including custom/
.Application settings are configured in custom/conf/app.ini
. Distributions mayprovide a symlink for custom
using /etc/gitea/
.
- Quick Cheat Sheet
If thecustom
folder can’t be found next to the binary, check theGITEA_CUSTOM
environment variable; this can be used to override the default path to something else.GITEA_CUSTOM
might, for example, be set by an init script.List of Environment Variables
Note: Gitea must perform a full restart to see configuration changes.
To make Gitea serve a custom /robots.txt
(default: empty 404), create a file calledrobots.txt
in the custom
folder with .
Serving custom public files
To make Gitea serve custom public files (like pages and images), use the foldercustom/public/
as the webroot. Symbolic links will be followed.
Place the png image at the following path: custom/public/img/avatar_default.png
Customizing Gitea pages
The custom/templates
folder allows changing every single page of Gitea. Templatesto override can be found in the templates
directory of Gitea source. Override bymaking a copy of the file under custom/templates
using a full path structurematching source.
Any statement contained inside {{
and }}
are Gitea’s templete syntax andshouldn’t be touched without fully understanding these components.
If all you want is to add extra links to the top navigation bar, or extra tabs to the repository view, you can put them in extra_links.tmpl
and extra_tabs.tmpl
inside your custom/templates/custom/
directory.
For instance, let’s say you are in Germany and must add the famously legally-required “Impressum”/about page, listing who is responsible for the site’s content:just place it under your “custom/public/” directory (for instance ) and put a link to it in custom/templates/custom/extra_links.tmpl
.
You can add new tabs in the same way, putting them in extra_tabs.tmpl
.The exact HTML needed to match the style of other tabs is in the filetemplates/repo/header.tmpl
(source in GitHub)
Other additions to the page
Apart from extra_links.tmpl
and extra_tabs.tmpl
, there are other useful templates you can put in your custom/templates/custom/
directory:
- body_outer_pre.tmpl, right after the start of .
- body_inner_pre.tmpl, before the top navigation bar, but already inside the main container .
- body_inner_post.tmpl, before the end of the main container.
- body_outer_post.tmpl, before the bottom
- footer.tmpl, right before the end of the tag, a good place for additional Javascript.
Place custom files in corresponding sub-folder under custom/options
.
Customizing the look of Gitea
Gitea has two built-in themes, the default theme gitea
, and a dark theme arc-green
. To change the look of your Gitea install change the value of in the section of app.ini
to another one of the available options.