diff options
author | Bjørn Erik Pedersen <[email protected]> | 2023-05-17 09:59:57 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2023-05-17 22:13:29 +0200 |
commit | 5d857165fed4649c3aa639a1555a15b8b1c75bab (patch) | |
tree | 9eafd7d8b85ec4c9bc9a16c83172c3a2b1d57e41 /resources | |
parent | 0106cf1a6db73f76b7f26744fcee6ce7f41cdf07 (diff) | |
download | hugo-5d857165fed4649c3aa639a1555a15b8b1c75bab.tar.gz hugo-5d857165fed4649c3aa639a1555a15b8b1c75bab.zip |
Deprecate site.Language.Params and some other fixes
Updates #10947
Diffstat (limited to 'resources')
-rw-r--r-- | resources/page/site.go | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/resources/page/site.go b/resources/page/site.go index 67b15cd8a..d36857bb1 100644 --- a/resources/page/site.go +++ b/resources/page/site.go @@ -37,6 +37,9 @@ type Site interface { GetPage(ref ...string) (Page, error) + // AllPages returns all pages for all languages. + AllPages() Pages + // Returns all the regular Pages in this Site. RegularPages() Pages @@ -104,6 +107,9 @@ type Site interface { // Author is deprecated and will be removed in a future release. Author() map[string]interface{} + // Authors is deprecated and will be removed in a future release. + Authors() AuthorList + // Returns the social links for this site. Social() map[string]string @@ -115,6 +121,12 @@ type Site interface { // For internal use only. GetPageWithTemplateInfo(info tpl.Info, ref ...string) (Page, error) + + // BuildDraft is deprecated and will be removed in a future release. + BuildDrafts() bool + + // IsMultilingual reports whether this site is configured with more than one language. + IsMultiLingual() bool } // Sites represents an ordered list of sites (languages). @@ -146,6 +158,9 @@ func (s *siteWrapper) Social() map[string]string { func (s *siteWrapper) Author() map[string]interface{} { return s.s.Author() } +func (s *siteWrapper) Authors() AuthorList { + return AuthorList{} +} func (s *siteWrapper) GoogleAnalytics() string { return s.s.GoogleAnalytics() @@ -159,6 +174,10 @@ func (s *siteWrapper) Language() *langs.Language { return s.s.Language() } +func (s *siteWrapper) AllPages() Pages { + return s.s.AllPages() +} + func (s *siteWrapper) RegularPages() Pages { return s.s.RegularPages() } @@ -247,6 +266,14 @@ func (s *siteWrapper) GetPageWithTemplateInfo(info tpl.Info, ref ...string) (Pag return s.s.GetPageWithTemplateInfo(info, ref...) } +func (s *siteWrapper) BuildDrafts() bool { + return s.s.BuildDrafts() +} + +func (s *siteWrapper) IsMultiLingual() bool { + return s.s.IsMultiLingual() +} + func (s *siteWrapper) DisqusShortname() string { return s.s.DisqusShortname() } @@ -259,6 +286,9 @@ type testSite struct { func (s testSite) Author() map[string]interface{} { return nil } +func (s testSite) Authors() AuthorList { + return AuthorList{} +} func (s testSite) Social() map[string]string { return make(map[string]string) @@ -332,6 +362,10 @@ func (t testSite) Pages() Pages { return nil } +func (t testSite) AllPages() Pages { + return nil +} + func (t testSite) RegularPages() Pages { return nil } @@ -368,6 +402,14 @@ func (testSite) DisqusShortname() string { return "" } +func (s testSite) BuildDrafts() bool { + return false +} + +func (s testSite) IsMultiLingual() bool { + return false +} + // NewDummyHugoSite creates a new minimal test site. func NewDummyHugoSite(cfg config.Provider) Site { return testSite{ |