Skip to content

Commit 45c264f

Browse files
AlbertoGPlafriks
authored andcommitted
Templates for extra links in top navbar and repo tool tabs. (#3308)
These templates add content to the top navbar and to the repository page. This way we do not have to copy and modify the whole template, and re-modify it after upgrading Gitea if it changes. Signed-off-by: Alberto González Palomo <[email protected]>
1 parent 88a3bb6 commit 45c264f

File tree

5 files changed

+7
-0
lines changed

5 files changed

+7
-0
lines changed

docs/content/doc/advanced/customizing-gitea.en-us.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ To add custom HTML to the header or the footer of the page, in the `templates/cu
6666
directory there is `header.tmpl` and `footer.tmpl` that can be modified. This can be
6767
a useful place to add custom CSS files or additional Javascript.
6868

69+
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.
70+
6971
## Customizing gitignores, labels, licenses, locales, and readmes.
7072

7173
Place custom files in corresponding sub-folder under `custom/options`.

templates/base/head.tmpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@
158158
{{end}}
159159

160160
<a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/repos">{{.i18n.Tr "explore"}}</a>
161+
162+
{{template "custom/extra_links" .}}
163+
161164
{{/*
162165
<div class="item">
163166
<div class="ui icon input">

templates/custom/extra_links.tmpl

Whitespace-only changes.

templates/custom/extra_tabs.tmpl

Whitespace-only changes.

templates/repo/header.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@
8989
</a>
9090
{{end}}
9191

92+
{{template "custom/extra_tabs" .}}
93+
9294
{{if .IsRepositoryAdmin}}
9395
<div class="right menu">
9496
<a class="{{if .PageIsSettings}}active{{end}} item" href="{{.RepoLink}}/settings">

0 commit comments

Comments
 (0)