Gitea: Custom templates doesn't work

Created on 29 Dec 2016  路  15Comments  路  Source: go-gitea/gitea

  • 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

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

kinbug

Most helpful comment

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

All 15 comments

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.

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!

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.

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!

We will resolve this issue for 1.1

@tboerger any update?

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

resolved by #1087

Hi,

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

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

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

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.

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.

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

image

Use template from correct version branch

Was this page helpful?
0 / 5 - 0 ratings

Related issues

BNolet picture BNolet  路  3Comments

Fastidious picture Fastidious  路  3Comments

mirhec picture mirhec  路  3Comments

tuxfanou picture tuxfanou  路  3Comments

flozz picture flozz  路  3Comments