[Improvement] use go-elem for HTML pages #786

Closed
opened 2025-12-29 02:23:59 +01:00 by adam · 8 comments
Owner

Originally created by @kradalby on GitHub (Sep 9, 2024).

Originally assigned to: @amha-mersha on GitHub.

Use case

We currently have a couple of HTML files/template strings in the code using gotemplate and handcrafted HTML, its not a lot, and its fine, but a nice QoL improvement would be to make them nice, typed and generated.

Description

I have had quite a good experience with go-elem for this for some other projects, ergonomics are pretty good for writing HTML as functions, at least if we consider that it is Go and not something like Elm, Roc or Scala which might allow a bit nicer funcs.

Contribution

  • I can write the design doc for this feature
  • I can contribute this feature

How can it be implemented?

I will eventually do this, but if someone is up for converting the HTML to go-elem, that would be a great PR/starter issue, make things neat and reusable.

Originally created by @kradalby on GitHub (Sep 9, 2024). Originally assigned to: @amha-mersha on GitHub. ### Use case We currently have a couple of HTML files/template strings in the code using gotemplate and handcrafted HTML, its not a lot, and its fine, but a nice QoL improvement would be to make them nice, typed and generated. ### Description I have had quite a good experience with [go-elem](https://github.com/chasefleming/elem-go) for this for some other projects, ergonomics are pretty good for writing HTML as functions, at least if we consider that it is Go and not something like Elm, Roc or Scala which might allow a bit nicer funcs. ### Contribution - [ ] I can write the design doc for this feature - [X] I can contribute this feature ### How can it be implemented? I will eventually do this, but if someone is up for converting the HTML to go-elem, that would be a great PR/starter issue, make things neat and reusable.
adam added the enhancementgood first issueno-stale-bot labels 2025-12-29 02:23:59 +01:00
adam closed this issue 2025-12-29 02:23:59 +01:00
Author
Owner

@amha-mersha commented on GitHub (Sep 9, 2024):

Hello @kradalby , I really would like to take this and work on it.

@amha-mersha commented on GitHub (Sep 9, 2024): Hello @kradalby , I really would like to take this and work on it.
Author
Owner

@kradalby commented on GitHub (Sep 9, 2024):

@amha-mersha sounds good, I think we will not merge anything until after 0.23.0 goes in, but I think a good approach would be to make a PR converting something small, like https://github.com/juanfont/headscale/blob/main/hscontrol/handlers.go#L141-L168 would be a good start!

@kradalby commented on GitHub (Sep 9, 2024): @amha-mersha sounds good, I think we will not merge anything until after 0.23.0 goes in, but I think a good approach would be to make a PR converting something small, like https://github.com/juanfont/headscale/blob/main/hscontrol/handlers.go#L141-L168 would be a good start!
Author
Owner

@amha-mersha commented on GitHub (Sep 9, 2024):

Sure @kradalby , do you need to assign it to me or do I just do it and make a PR

@amha-mersha commented on GitHub (Sep 9, 2024): Sure @kradalby , do you need to assign it to me or do I just do it and make a PR
Author
Owner

@kradalby commented on GitHub (Sep 9, 2024):

I assigned it so people know, but other than that you can make a PR.

@kradalby commented on GitHub (Sep 9, 2024): I assigned it so people know, but other than that you can make a PR.
Author
Owner

@amha-mersha commented on GitHub (Sep 9, 2024):

Thank you @kradalby for assigning me my first open-source contribution, I have finished it and made a PR. Are there other things I can work on.

@amha-mersha commented on GitHub (Sep 9, 2024): Thank you @kradalby for assigning me my first open-source contribution, I have finished it and made a PR. Are there other things I can work on.
Author
Owner

@kradalby commented on GitHub (Sep 10, 2024):

You can also start on https://github.com/juanfont/headscale/blob/main/hscontrol/templates/windows.html, and where it is called in the code. the more you can make functions to reuse the better

@kradalby commented on GitHub (Sep 10, 2024): You can also start on https://github.com/juanfont/headscale/blob/main/hscontrol/templates/windows.html, and where it is called in the code. the more you can make functions to reuse the better
Author
Owner

@kradalby commented on GitHub (Sep 20, 2024):

There is also styles and templates for OIDC here that needs to be rewritten: 10a72e8d54/hscontrol/oidc.go (L161-L166)

This contains other styling than the current one, we should unify this so it all looks the same and can have the style reused.

@kradalby commented on GitHub (Sep 20, 2024): There is also styles and templates for OIDC here that needs to be rewritten: https://github.com/juanfont/headscale/blob/10a72e8d542af68c0c280f2a6ccc84849719b24c/hscontrol/oidc.go#L161-L166 This contains other styling than the current one, we should unify this so it all looks the same and can have the style reused.
Author
Owner

@jirutka commented on GitHub (Nov 4, 2024):

I would greatly appreciate it if these were simple HTML templates that can be read from the filesystem so admins can easily customize them to their organization’s visual style, add additional information etc.

@jirutka commented on GitHub (Nov 4, 2024): I would greatly appreciate it if these were simple HTML templates that can be read from the filesystem so admins can easily customize them to their organization’s visual style, add additional information etc.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#786