mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-25 22:00:58 +02:00
Add Sections to Site interface
See https://github.com/gohugoio/hugo/issues/10947#issuecomment-1550012671 Updates #10947
This commit is contained in:
@@ -43,6 +43,9 @@ type Site interface {
|
||||
// Returns all Pages in this Site.
|
||||
Pages() Pages
|
||||
|
||||
// Returns all the top level sections.
|
||||
Sections() Pages
|
||||
|
||||
// A shortcut to the home
|
||||
Home() Page
|
||||
|
||||
@@ -164,6 +167,10 @@ func (s *siteWrapper) Pages() Pages {
|
||||
return s.s.Pages()
|
||||
}
|
||||
|
||||
func (s *siteWrapper) Sections() Pages {
|
||||
return s.s.Sections()
|
||||
}
|
||||
|
||||
func (s *siteWrapper) Home() Page {
|
||||
return s.s.Home()
|
||||
}
|
||||
@@ -285,6 +292,10 @@ func (t testSite) Sites() Sites {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t testSite) Sections() Pages {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t testSite) GetPage(ref ...string) (Page, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user