-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
templates: migrate OIDC callback to elem-go, give an overhaul #2832
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16cf9df to
8a378e2
Compare
8a378e2 to
32d81f3
Compare
nblock
approved these changes
Nov 12, 2025
| @@ -0,0 +1,145 @@ | |||
| /* CSS Variables from Material for MkDocs */ | |||
Collaborator
There was a problem hiding this comment.
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]>
63fb756 to
37094c9
Compare
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.
37094c9 to
41187a8
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #2115
claude was used in this PR.