Skip to content

Conversation

@kradalby
Copy link
Collaborator

@kradalby kradalby commented Oct 28, 2025

apple_desktop oidc_callback_desktop

Closes #2115

claude was used in this PR.

@kradalby kradalby force-pushed the kradalby/goelem-oidc branch from 16cf9df to 8a378e2 Compare November 11, 2025 20:38
@kradalby kradalby marked this pull request as ready for review November 11, 2025 20:46
@kradalby kradalby added this to the v0.28.0 milestone Nov 11, 2025
@kradalby kradalby force-pushed the kradalby/goelem-oidc branch from 8a378e2 to 32d81f3 Compare November 12, 2025 03:54
@@ -0,0 +1,145 @@
/* CSS Variables from Material for MkDocs */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: style.css and headscale.svg should probably be moved to the hscontrol/assets/ directory or favicon.ico should be moved into hscontrol/templates/.

Replace html/template with type-safe elem-go templating for OIDC
callback page. Improves consistency with other templates and provides
compile-time safety. All UI elements and styling preserved.
Add design system assets for HTML templates:
- headscale.svg: Logo with optimized viewBox for proper alignment
- style.css: Material for MkDocs CSS variables and typography
- design.go: Design system constants for consistent styling

The logo viewBox is adjusted to 32.92 0 1247.08 640 to eliminate
whitespace from the original export and ensure left alignment with
text content.
Refactor template system to use go:embed for external assets and
CSS classes for styling instead of inline styles:

- general.go: Add go:embed directives for style.css and headscale.svg,
  replace inline styles with CSS classes (H1, H2, H3, P, etc.),
  add mdTypesetBody wrapper with Material for MkDocs styling

- apple.go, oidc_callback.go, register_web.go, windows.go:
  Update to use new CSS-based helper functions (H1, H2, P, etc.)
  and mdTypesetBody for consistent layout

This separates content from presentation, making templates easier
to maintain and update. All styling is now centralized in style.css
with Material for MkDocs design system.
Add test to validate HTML template output consistency across all
templates (OIDC callback, registration, Windows, Apple).

Verifies all templates produce valid HTML5 with:
- Proper DOCTYPE declaration
- HTML5 lang attribute
- UTF-8 charset
- Viewport meta tag
- Semantic HTML structure

Ensures template refactoring maintains standards compliance.
Signed-off-by: Kristoffer Dalby <[email protected]>
@kradalby kradalby force-pushed the kradalby/goelem-oidc branch from 63fb756 to 37094c9 Compare November 12, 2025 13:25
Move favicon.png, style.css, and headscale.svg to hscontrol/assets/
and create a single assets.go file with all embed directives.

Update hscontrol/handlers.go and hscontrol/templates/general.go to
use the centralized assets package.
@kradalby kradalby force-pushed the kradalby/goelem-oidc branch from 37094c9 to 41187a8 Compare November 12, 2025 14:09
@kradalby kradalby enabled auto-merge (rebase) November 12, 2025 14:10
@kradalby kradalby merged commit e3ced80 into juanfont:main Nov 12, 2025
97 of 98 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Improvement] use go-elem for HTML pages

2 participants