Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Routing / new Pages?! #2115

Closed
2 of 7 tasks
CMiksche opened this issue Jul 5, 2017 · 5 comments
Closed
2 of 7 tasks

Custom Routing / new Pages?! #2115

CMiksche opened this issue Jul 5, 2017 · 5 comments
Labels
type/enhancement An improvement of existing functionality
Milestone

Comments

@CMiksche
Copy link

CMiksche commented Jul 5, 2017

  • Gitea version (or commit ref): v1.1.2
  • Git version: 2.11.0
  • Operating system: Ubuntu 17.04
  • 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: None

Description

Is there any way to create custom pages with the templating engine and custom routes?

Here in germany, we need at least two custom sites (imprint and privacy policy) and it would be great, if i could create this two sites in the custom directory.

The template files can already be created in custom/templates but how do i define the routing?

It looks like the routing is made in go files in the routers directory? That means i would have to edit the source files? (And updates would destroy my changes?)

Screenshots

None

@lafriks
Copy link
Member

lafriks commented Jul 5, 2017

Probably this could be created adding new reserved name pages and something like Gitea wiki but editable only by admins

@lunny lunny added the type/question Issue needs no code to be fixed, only a description on how to fix it yourself. label Jul 6, 2017
@AlbertoGP
Copy link
Contributor

After #3308 "Templates for extra links in top navbar and repo tool tabs." you can do this by placing your extra sites/pages under your "custom/public/" directory (for instance custom/public/impressum.html) and putting links to them in custom/templates/custom/extra_links.tmpl:
https://docs.gitea.io/en-us/customizing-gitea/#customizing-gitea-pages

To match the current style, the link should have class name "item":
<a class="item" href="{{AppSubUrl}}/impressum.html">Impressum</a>

@lafriks
Copy link
Member

lafriks commented Jan 10, 2018

That should be added to docs

@AlbertoGP
Copy link
Contributor

Hi, I've added that information to the docs and also listed all the other template hooks at the PR "Improve documentation about custom templates. #3345"

@CMiksche
Copy link
Author

Sounds good. Im closing this issue now

@lunny lunny added type/enhancement An improvement of existing functionality and removed type/question Issue needs no code to be fixed, only a description on how to fix it yourself. labels Jan 12, 2018
@lunny lunny added this to the 1.4.0 milestone Jan 12, 2018
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/enhancement An improvement of existing functionality
Projects
None yet
Development

No branches or pull requests

4 participants