From 34c5eee703e8904f9eae662bc774ef0b26656799 Mon Sep 17 00:00:00 2001 From: Bagas Sanjaya Date: Sat, 4 Jan 2020 01:41:56 +0700 Subject: [PATCH] Add footer extra links template (#9576) * Add footer extra links template * [Docs] Update to mention extra links footer template * Commit suggestion from @davidsvantesson Co-Authored-By: David Svantesson * Move template placement to right side of footer Co-authored-by: David Svantesson Co-authored-by: Lauris BH --- docs/content/doc/advanced/customizing-gitea.en-us.md | 4 ++-- templates/base/footer_content.tmpl | 1 + templates/custom/extra_links_footer.tmpl | 0 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 templates/custom/extra_links_footer.tmpl diff --git a/docs/content/doc/advanced/customizing-gitea.en-us.md b/docs/content/doc/advanced/customizing-gitea.en-us.md index 8db022772d..7ae9b74fa2 100644 --- a/docs/content/doc/advanced/customizing-gitea.en-us.md +++ b/docs/content/doc/advanced/customizing-gitea.en-us.md @@ -80,10 +80,10 @@ Dont forget to restart your gitea to apply the changes. ### Adding links and tabs -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. +If all you want is to add extra links to the top navigation bar or footer, or extra tabs to the repository view, you can put them in `extra_links.tmpl` (links added to the navbar), `extra_links_footer.tmpl` (links added to the left side of footer), 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 `custom/public/impressum.html`) and put a link to it in `custom/templates/custom/extra_links.tmpl`. +just place it under your "custom/public/" directory (for instance `custom/public/impressum.html`) and put a link to it in either `custom/templates/custom/extra_links.tmpl` or `custom/templates/custom/extra_links_footer.tmpl`. To match the current style, the link should have the class name "item", and you can use `{{AppSubUrl}}` to get the base URL: `Impressum` diff --git a/templates/base/footer_content.tmpl b/templates/base/footer_content.tmpl index 364e58a3d0..085e7207df 100644 --- a/templates/base/footer_content.tmpl +++ b/templates/base/footer_content.tmpl @@ -19,6 +19,7 @@ JavaScript licenses {{if .EnableSwagger}}API{{end}} {{.i18n.Tr "website"}} + {{template "custom/extra_links_footer" .}} {{if (or .ShowFooterVersion .PageIsAdmin)}}{{GoVer}}{{end}} diff --git a/templates/custom/extra_links_footer.tmpl b/templates/custom/extra_links_footer.tmpl new file mode 100644 index 0000000000..e69de29bb2 -- 2.39.5