docs: add sticky header support for documentation pages

- Add CSS rules to web/static/input.css for header positioning
- Header is sticky only on /docs pages via .page-docs body class
- Add page-docs class to body element in templates/docs.templ
- Non-docs pages have static header position
This commit is contained in:
2026-02-03 16:16:14 -05:00
parent d9c6be1429
commit 79373dd225
5 changed files with 41 additions and 527 deletions
+3 -8
View File
@@ -110,6 +110,7 @@ func (h *HTTPHandler) ShowAPIEndpoint(c echo.Context, endpointPath string) error
// Get endpoint data for the explorer
endpointInfo, err := h.docs.GetAPIEndpointData(endpointPath)
_ = endpointInfo
if err != nil {
// Endpoint not found in explorer data, fall back to old behavior
return h.showLegacyAPIEndpoint(c, endpointPath, isLoggedIn)
@@ -168,16 +169,10 @@ func (h *HTTPHandler) ShowAPIEndpoint(c echo.Context, endpointPath string) error
}
}
// Create API explorer data
explorerData := templates.APIExplorerData{
Endpoint: *endpointInfo,
IsLoggedIn: isLoggedIn,
}
// Render API endpoint page with explorer
// Render API endpoint page
var buf bytes.Buffer
currentPath := c.Request().URL.Path
err = templates.DocsLayoutWithExplorer(*nav, *doc, user, explorerData, currentPath).Render(c.Request().Context(), &buf)
err = templates.DocsLayout(*nav, *doc, user, currentPath).Render(c.Request().Context(), &buf)
if err != nil {
return c.HTML(http.StatusInternalServerError, "Failed to render page")