head.tmpl cannot be customized - crashes #2163

Closed
opened 2025-11-02 04:25:44 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @methodbox on GitHub (Aug 9, 2018).

  • Gitea version (or commit ref): 1.5
  • Git version: 2.18
  • Operating system: CentOS
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

Please excuse the fact that I’m on mobile and cannot fully complete this form.

The issue is simple: creating [gitea root dir]/custom/templates/base/head.tmpl and importing the default head.tmpl will not allow Gitea to run.

Putting a simple head.tmpl with just html allows it to run but this prevents making simple modifications (like removing buttons) a real pain.

I’ve worked around it by making a custom .../custom/templates/header.tmpl (not a typo) and importing JS to remove the elements I don’t want.

If there is a better way to modify the navigation links than replacing the head.tmpl with my own, slightly modified version, I’m all ears.

Screenshots

Originally created by @methodbox on GitHub (Aug 9, 2018). <!-- 1. Please speak English, this is the language all of us can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/NsatcWJ) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.5 - Git version: 2.18 - Operating system: CentOS - Database (use `[x]`): - [ ] PostgreSQL - [x] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: ## Description Please excuse the fact that I’m on mobile and cannot fully complete this form. The issue is simple: creating [gitea root dir]**/custom/templates/base/head.tmpl** and importing the *default* **head.tmpl will not allow Gitea to run.** **Putting a simple head.tmpl with just html allows it to run** but this prevents making simple modifications (like removing buttons) a real pain. I’ve worked around it by making a custom .../custom/templates/header.tmpl (not a typo) and importing JS to remove the elements I don’t want. If there is a better way to modify the navigation links than replacing the head.tmpl with my own, slightly modified version, I’m all ears. ## Screenshots <!-- **If this issue involves the Web Interface, please include a screenshot** -->
GiteaMirror added the type/question label 2025-11-02 04:25:44 -06:00
Author
Owner

@lafriks commented on GitHub (Aug 10, 2018):

Yes there is custom/templates/custom/... templates that can be used to add css and scripts. See docs section customization for more details

@lafriks commented on GitHub (Aug 10, 2018): Yes there is custom/templates/custom/... templates that can be used to add css and scripts. See docs section customization for more details
Author
Owner

@lafriks commented on GitHub (Aug 10, 2018):

In future please use forum (https://discourse.gitea.io/) for such questions

@lafriks commented on GitHub (Aug 10, 2018): In future please use forum (https://discourse.gitea.io/) for such questions
Author
Owner

@methodbox commented on GitHub (Aug 10, 2018):

This isn’t a question. Please read again.

And you’re supposed to be able to override existing templates by putting them in /templates/path/like/source.

This is not working.

You closed my issue for the wrong reason.

Please read again.

@methodbox commented on GitHub (Aug 10, 2018): This isn’t a question. Please read again. And you’re supposed to be able to override existing templates by putting them in /templates/path/like/source. This is not working. You closed my issue for the wrong reason. Please read again.
Author
Owner

@methodbox commented on GitHub (Aug 10, 2018):

I put the parts in bold that are important here. You reacted to the wrong statement.

You guys constantly close issues that are actual issues; wondering if you actually read the issue.

@methodbox commented on GitHub (Aug 10, 2018): I put the parts in bold that are important here. You reacted to the wrong statement. You guys constantly close issues that are actual issues; wondering if you actually read the issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#2163