mirror of
https://github.com/gohugoio/hugo.git
synced 2026-09-03 12:12:37 +00:00
@@ -73,6 +73,9 @@ type HugoSites struct {
|
||||
// Render output formats for all sites.
|
||||
renderFormats output.Formats
|
||||
|
||||
// The currently rendered Site.
|
||||
currentSite *Site
|
||||
|
||||
*deps.Deps
|
||||
|
||||
gitInfo *gitInfo
|
||||
|
||||
@@ -289,6 +289,7 @@ func (h *HugoSites) render(config *BuildCfg) error {
|
||||
|
||||
i := 0
|
||||
for _, s := range h.Sites {
|
||||
h.currentSite = s
|
||||
for siteOutIdx, renderFormat := range s.renderFormats {
|
||||
siteRenderContext.outIdx = siteOutIdx
|
||||
siteRenderContext.sitesOutIdx = i
|
||||
|
||||
@@ -738,6 +738,11 @@ func (s *SiteInfo) Sites() page.Sites {
|
||||
return s.s.h.siteInfos()
|
||||
}
|
||||
|
||||
// Current returns the currently rendered Site.
|
||||
func (s *SiteInfo) Current() page.Site {
|
||||
return s.s.h.currentSite.Info
|
||||
}
|
||||
|
||||
func (s *SiteInfo) String() string {
|
||||
return fmt.Sprintf("Site(%q)", s.title)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user