"regexp"
"sort"
"strings"
+ "time"
"github.com/gohugoio/hugo/common/maps"
return json.Marshal(&struct {
Path string `json:"path"`
Version string `json:"version"`
+ Time *time.Time `json:"time"`
Owner string `json:"owner"`
Dir string `json:"dir"`
Meta map[string]interface{} `json:"meta"`
}{
Path: m.m.Path(),
Version: m.m.Version(),
+ Time: m.m.Time(),
Owner: ownerPath,
Dir: m.m.Dir(),
Meta: config.Params,
return json.Marshal(&struct {
Path string `json:"path"`
Version string `json:"version"`
+ Time *time.Time `json:"time"`
Owner string `json:"owner"`
Dir string `json:"dir"`
Mounts []modMount `json:"mounts"`
}{
Path: m.m.Path(),
Version: m.m.Version(),
+ Time: m.m.Time(),
Owner: ownerPath,
Dir: m.m.Dir(),
Mounts: mounts,
package modules
import (
+ "time"
+
"github.com/gohugoio/hugo/config"
)
// The module version.
Version() string
+ // Time version was created.
+ Time() *time.Time
+
// Whether this module's dir is a watch candidate.
Watch() bool
}
return m.gomod.Version
}
+func (m *moduleAdapter) Time() *time.Time {
+ if !m.IsGoMod() || m.gomod.Time == nil {
+ return nil
+ }
+
+ return m.gomod.Time
+}
+
func (m *moduleAdapter) Watch() bool {
if m.Owner() == nil {
// Main project