feat(ui): custom HTML content in predefined locations (#2621)

This commit is contained in:
Aaron Liu
2025-07-15 10:44:51 +08:00
parent ca57ca1ba0
commit 000124f6c7
5 changed files with 22 additions and 1 deletions

View File

@@ -200,6 +200,8 @@ type (
CustomProps(ctx context.Context) []types.CustomProps
// CustomNavItems returns the custom nav items settings.
CustomNavItems(ctx context.Context) []CustomNavItem
// CustomHTML returns the custom HTML settings.
CustomHTML(ctx context.Context) *CustomHTML
}
UseFirstSiteUrlCtxKey = struct{}
)
@@ -227,6 +229,13 @@ type (
}
)
func (s *settingProvider) CustomHTML(ctx context.Context) *CustomHTML {
return &CustomHTML{
HeadlessFooter: s.getString(ctx, "headless_footer_html", ""),
HeadlessBody: s.getString(ctx, "headless_bottom_html", ""),
SidebarBottom: s.getString(ctx, "sidebar_bottom_html", ""),
}
}
func (s *settingProvider) CustomNavItems(ctx context.Context) []CustomNavItem {
raw := s.getString(ctx, "custom_nav_items", "[]")
var items []CustomNavItem