diff --git a/helper/slice/slice.go b/helper/slice/slice.go index 61e83d9..7ecd8e3 100644 --- a/helper/slice/slice.go +++ b/helper/slice/slice.go @@ -280,3 +280,9 @@ func IndexOf[T comparable](a []T, v T) int { } return -1 } + +func ForEach[T any](a []T, fn func(i int, v T)) { + for i, t := range a { + fn(i, t) + } +} diff --git a/internal/pkg/constraints/components/constraints.go b/internal/pkg/constraints/components/constraints.go new file mode 100644 index 0000000..ae9b950 --- /dev/null +++ b/internal/pkg/constraints/components/constraints.go @@ -0,0 +1,8 @@ +package components + +const ( + SearchFormArgs = "SearchFormArgs" + RecentPostsArgs = "RecentPostsArgs" + RecentCommentsArgs = "RecentCommentsArgs" + ArchiveArgs = "ArchiveArgs" +) diff --git a/internal/pkg/constraints/const.go b/internal/pkg/constraints/const.go index ff7452d..89a7c71 100644 --- a/internal/pkg/constraints/const.go +++ b/internal/pkg/constraints/const.go @@ -17,6 +17,7 @@ const ( Defaults = "default" - HeadScript = "headScript" - FooterScript = "footerScript" + HeadScript = "headScript" + FooterScript = "footerScript" + SidebarsWidgets = "sidebarsWidgets" ) diff --git a/internal/theme/twentyfifteen/layout/sidebar.gohtml b/internal/theme/twentyfifteen/layout/sidebar.gohtml index 67b5a6c..02bad3c 100644 --- a/internal/theme/twentyfifteen/layout/sidebar.gohtml +++ b/internal/theme/twentyfifteen/layout/sidebar.gohtml @@ -1,20 +1,7 @@ {{define "layout/sidebar" }}