Browse Source

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 <bugs@sentido-labs.com>
tags/v1.4.0-rc1
Alberto González Palomo 6 years ago
parent
commit
45c264f681

+ 2
- 0
docs/content/doc/advanced/customizing-gitea.en-us.md View File

@@ -66,6 +66,8 @@ To add custom HTML to the header or the footer of the page, in the `templates/cu
directory there is `header.tmpl` and `footer.tmpl` that can be modified. This can be
a useful place to add custom CSS files or additional Javascript.

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.

## Customizing gitignores, labels, licenses, locales, and readmes.

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

+ 3
- 0
templates/base/head.tmpl View File

@@ -158,6 +158,9 @@
{{end}}

<a class="item{{if .PageIsExplore}} active{{end}}" href="{{AppSubUrl}}/explore/repos">{{.i18n.Tr "explore"}}</a>

{{template "custom/extra_links" .}}

{{/*
<div class="item">
<div class="ui icon input">

+ 0
- 0
templates/custom/extra_links.tmpl View File


+ 0
- 0
templates/custom/extra_tabs.tmpl View File


+ 2
- 0
templates/repo/header.tmpl View File

@@ -89,6 +89,8 @@
</a>
{{end}}

{{template "custom/extra_tabs" .}}

{{if .IsRepositoryAdmin}}
<div class="right menu">
<a class="{{if .PageIsSettings}}active{{end}} item" href="{{.RepoLink}}/settings">

Loading…
Cancel
Save