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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user