Custom templates doesn't work #179

Closed
opened 2025-11-02 03:12:29 -06:00 by GiteaMirror · 15 comments
Owner

Originally created by @gdudas on GitHub (Dec 29, 2016).

Originally assigned to: @tboerger on GitHub.

  • Gitea version (or commit ref): v1.0.0+34-gac51caa
  • Git version: 2.8.3
  • Operating system: Linux amd64
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

Adding a custom template under custom/templates doesn't work.

Thomas Boerger @tboerger 14:29
let me check the macaron renderer source
looks like we need to implement a custom TemplateFileSystem because AppendDirectories gets ignored by the bindata based TemplateFileSystem from https://github.com/go-macaron/bindata

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/40471993-custom-templates-doesn-t-work?utm_campaign=plugin&utm_content=tracker%2F47456670&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F47456670&utm_medium=issues&utm_source=github).
Originally created by @gdudas on GitHub (Dec 29, 2016). Originally assigned to: @tboerger on GitHub. - Gitea version (or commit ref): v1.0.0+34-gac51caa - Git version: 2.8.3 - Operating system: Linux amd64 - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [x] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [x] Not relevant - Log gist: ## Description Adding a custom template under custom/templates doesn't work. > Thomas Boerger @tboerger 14:29 > let me check the macaron renderer source > looks like we need to implement a custom TemplateFileSystem because AppendDirectories gets ignored by the bindata based TemplateFileSystem from https://github.com/go-macaron/bindata <bountysource-plugin> --- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/40471993-custom-templates-doesn-t-work?utm_campaign=plugin&utm_content=tracker%2F47456670&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F47456670&utm_medium=issues&utm_source=github). </bountysource-plugin>
GiteaMirror added the type/bug label 2025-11-02 03:12:29 -06:00
Author
Owner

@strk commented on GitHub (Dec 29, 2016):

For reference, this was known before the bug was introduced here:
https://github.com/go-gitea/gitea/pull/314#issuecomment-265191763

Should be only when bindata build tag is used.

@strk commented on GitHub (Dec 29, 2016): For reference, this was known before the bug was introduced here: https://github.com/go-gitea/gitea/pull/314#issuecomment-265191763 Should be only when `bindata` build tag is used.
Author
Owner

@esell commented on GitHub (Jan 12, 2017):

Just curious, if we are using the download from the "master" directory here: https://dl.gitea.io/gitea/master/ are custom templates expected to work? I'm a little lost with the dialog as to if the issue has been resolved or if it's still pending. Thanks!

@esell commented on GitHub (Jan 12, 2017): Just curious, if we are using the download from the "master" directory here: https://dl.gitea.io/gitea/master/ are custom templates expected to work? I'm a little lost with the dialog as to if the issue has been resolved or if it's still pending. Thanks!
Author
Owner

@strk commented on GitHub (Jan 12, 2017):

Issue is still pending for builds with 'bindata' tag.
The downloads from dl.gitea.io are of this kind (so broken).

I guess it would help to include the build tags in the version
string as printed by some footers, btw.

@strk commented on GitHub (Jan 12, 2017): Issue is still pending for builds with 'bindata' tag. The downloads from dl.gitea.io are of this kind (so broken). I guess it would help to include the build tags in the version string as printed by some footers, btw.
Author
Owner

@esell commented on GitHub (Jan 12, 2017):

I actually was just coming back to edit my first post haha. I just realized the difference between bindata builds and non-bindata builds by RTFM and get it now, thanks for the quick response though!

@esell commented on GitHub (Jan 12, 2017): I actually was just coming back to edit my first post haha. I just realized the difference between bindata builds and non-bindata builds by RTFM and get it now, thanks for the quick response though!
Author
Owner

@tboerger commented on GitHub (Jan 12, 2017):

We will resolve this issue for 1.1

@tboerger commented on GitHub (Jan 12, 2017): We will resolve this issue for 1.1
Author
Owner

@lunny commented on GitHub (Feb 11, 2017):

@tboerger any update?

@lunny commented on GitHub (Feb 11, 2017): @tboerger any update?
Author
Owner

@tboerger commented on GitHub (Feb 21, 2017):

I will work on this within this week hopefully, but let's stop backporting that.

@tboerger commented on GitHub (Feb 21, 2017): I will work on this within this week hopefully, but let's stop backporting that.
Author
Owner

@lunny commented on GitHub (Mar 1, 2017):

resolved by #1087

@lunny commented on GitHub (Mar 1, 2017): resolved by #1087
Author
Owner

@ghost commented on GitHub (Nov 15, 2017):

Hi,

templates still not working for me. I've installed GiTea from Binaries (v1.2.3)

@ghost commented on GitHub (Nov 15, 2017): Hi, templates still not working for me. I've installed GiTea from Binaries (v1.2.3)
Author
Owner

@bkcsoft commented on GitHub (Nov 23, 2017):

@Wikiki Could you test v1.3.0-rc1? (After creating a backup of course). Since templates works just fine on https://try.gitea.io

@bkcsoft commented on GitHub (Nov 23, 2017): @Wikiki Could you test v1.3.0-rc1? (After creating a backup of course). Since templates works just fine on https://try.gitea.io
Author
Owner

@ghost commented on GitHub (Nov 23, 2017):

Hi @tboerger, I tried yesterday with 1.3 and its working 😃

@ghost commented on GitHub (Nov 23, 2017): Hi @tboerger, I tried yesterday with 1.3 and its working :smiley:
Author
Owner

@adilinden commented on GitHub (Apr 2, 2018):

Sorry for the noise, my mistake. Changing a template requires restarting gitea. I tried v1.4.0 again and my changed template is working there two now!

Is this working? I just installed v1.4.0 and am trying a customization of the splash page. I assume this should be custom/templates/home.tmpl. I created the file and made a change but nothing happens.

Just a note to add, I installed v1.3.3 and templated worked as expected. I just do not know if switching (downgrading) from v1.4.0 to v1.3.3 will break anything. I just ran the new (older) binary without making any other changes.

One last note, downloaded the binary from the binary downloads page.

@adilinden commented on GitHub (Apr 2, 2018): Sorry for the noise, my mistake. Changing a template requires restarting `gitea`. I tried v1.4.0 again and my changed template is working there two now! > Is this working? I just installed v1.4.0 and am trying a customization of the splash page. I assume this should be `custom/templates/home.tmpl`. I created the file and made a change but nothing happens. > > Just a note to add, I installed v1.3.3 and templated worked as expected. I just do not know if switching (downgrading) from v1.4.0 to v1.3.3 will break anything. I just ran the new (older) binary without making any other changes. > > One last note, downloaded the binary from the binary downloads page.
Author
Owner

@methodbox commented on GitHub (May 28, 2018):

This still doesn't seem to work with 1.4.1.

I've added a /custom/templates/custom directory along with the header.tmpl as explained here:
https://docs.gitea.io/en-us/customizing-gitea/

as to how to add custom CSS. I doesn't seem to do anything.

It would be helpful to have the documentation updated to better explain how to use custom CSS and Javascript.

As it stands that is very unclear.

It appears you are supposed to copy the existing *.tmpl files to the custom/templates directory and then edit them, but the home.tmpl, for example is in German, so that doesn't really help.

And even so, if that's the case - it doesn't work because my Gitea home page is still in English.

@methodbox commented on GitHub (May 28, 2018): This still doesn't seem to work with 1.4.1. I've added a /custom/templates/custom directory along with the header.tmpl as explained here: https://docs.gitea.io/en-us/customizing-gitea/ as to how to add custom CSS. I doesn't seem to do anything. It would be helpful to have the documentation updated to better explain how to use custom CSS and Javascript. As it stands that is very unclear. It appears you are supposed to copy the existing *.tmpl files to the custom/templates directory and then edit them, but the home.tmpl, for example is in German, so that doesn't really help. And even so, if that's the case - it doesn't work because my Gitea home page is still in English.
Author
Owner

@imPrashik commented on GitHub (May 16, 2020):

Running Windows Service with home.tmpl taken from master branch gives the error as following:

image

@imPrashik commented on GitHub (May 16, 2020): Running Windows Service with home.tmpl taken from master branch gives the error as following: ![image](https://user-images.githubusercontent.com/4114326/82121952-4ec72880-97ae-11ea-8b3e-65aab4b1ad09.png)
Author
Owner

@lafriks commented on GitHub (May 16, 2020):

Use template from correct version branch

@lafriks commented on GitHub (May 16, 2020): Use template from correct version branch
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#179