[Proposal] Make Gitea template system support context function #10697

Closed
opened 2025-11-02 09:15:50 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @wxiaoguang on GitHub (Apr 20, 2023).

Plan

After #24056, we have our own ScopedTemplate, which supports context functions.

This is a plan for next steps:

  • Wait for enough time to test and verify that our ScopedTemplate is stable enough
    • Maybe in about one month, use the edge build on gitea.com to eat our own dogfood
    • If there is anything wrong:
      • If it is fixable, improve the ScopedTemplate
      • If it is unfixable, revert to Golang's html/template (pity.....)
  • If Golang supports context function officially soon, switch to the official solution.

Then, if everything is fine:

  • Make locale use context function as the first refactoring step (maybe it, or maybe some other simple functions)
  • (TBC)
Originally created by @wxiaoguang on GitHub (Apr 20, 2023). ### Plan After #24056, we have our own ScopedTemplate, which supports context functions. This is a plan for next steps: * Wait for enough time to test and verify that our `ScopedTemplate` is stable enough * Maybe in about one month, use the edge build on gitea.com to eat our own dogfood * If there is anything wrong: * If it is fixable, improve the ScopedTemplate * If it is unfixable, revert to Golang's `html/template` (pity.....) * If Golang supports context function officially soon, switch to the official solution. Then, if everything is fine: * Make `locale` use context function as the first refactoring step (maybe it, or maybe some other simple functions) * (TBC)
GiteaMirror added the type/proposaltype/feature labels 2025-11-02 09:15:50 -06:00
Author
Owner

@wxiaoguang commented on GitHub (Jul 22, 2023):

Wait for Golang's official solution

https://go-review.googlesource.com/c/go/+/510738

@wxiaoguang commented on GitHub (Jul 22, 2023): Wait for Golang's official solution https://go-review.googlesource.com/c/go/+/510738
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10697