mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
@@ -31,6 +31,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/gohugoio/hugo/common/types"
|
||||
"github.com/gohugoio/hugo/modules"
|
||||
"golang.org/x/text/unicode/norm"
|
||||
|
||||
"github.com/gohugoio/hugo/common/paths"
|
||||
@@ -1333,6 +1334,32 @@ func (s *Site) initializeSiteInfo() error {
|
||||
}
|
||||
}
|
||||
|
||||
// Assemble dependencies to be used in hugo.Deps.
|
||||
// TODO(bep) another reminder: We need to clean up this Site vs HugoSites construct.
|
||||
var deps []*hugo.Dependency
|
||||
var depFromMod func(m modules.Module) *hugo.Dependency
|
||||
depFromMod = func(m modules.Module) *hugo.Dependency {
|
||||
dep := &hugo.Dependency{
|
||||
Path: m.Path(),
|
||||
Version: m.Version(),
|
||||
Time: m.Time(),
|
||||
Vendor: m.Vendor(),
|
||||
}
|
||||
|
||||
// These are pointers, but this all came from JSON so there's no recursive navigation,
|
||||
// so just create new values.
|
||||
if m.Replace() != nil {
|
||||
dep.Replace = depFromMod(m.Replace())
|
||||
}
|
||||
if m.Owner() != nil {
|
||||
dep.Owner = depFromMod(m.Owner())
|
||||
}
|
||||
return dep
|
||||
}
|
||||
for _, m := range s.Paths.AllModules {
|
||||
deps = append(deps, depFromMod(m))
|
||||
}
|
||||
|
||||
s.Info = &SiteInfo{
|
||||
title: lang.GetString("title"),
|
||||
Author: lang.GetStringMap("author"),
|
||||
@@ -1351,7 +1378,7 @@ func (s *Site) initializeSiteInfo() error {
|
||||
permalinks: permalinks,
|
||||
owner: s.h,
|
||||
s: s,
|
||||
hugoInfo: hugo.NewInfo(s.Cfg.GetString("environment")),
|
||||
hugoInfo: hugo.NewInfo(s.Cfg.GetString("environment"), deps),
|
||||
}
|
||||
|
||||
rssOutputFormat, found := s.outputFormats[page.KindHome].GetByName(output.RSSFormat.Name)
|
||||
|
Reference in New Issue
Block a user