mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
Create pages from _content.gotmpl
Closes #12427 Closes #12485 Closes #6310 Closes #5074
This commit is contained in:
@@ -111,6 +111,24 @@ func (h *HugoSites) ShouldSkipFileChangeEvent(ev fsnotify.Event) bool {
|
||||
return h.skipRebuildForFilenames[ev.Name]
|
||||
}
|
||||
|
||||
func (h *HugoSites) isRebuild() bool {
|
||||
return h.buildCounter.Load() > 0
|
||||
}
|
||||
|
||||
func (h *HugoSites) resolveSite(lang string) *Site {
|
||||
if lang == "" {
|
||||
lang = h.Conf.DefaultContentLanguage()
|
||||
}
|
||||
|
||||
for _, s := range h.Sites {
|
||||
if s.Lang() == lang {
|
||||
return s
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Only used in tests.
|
||||
type buildCounters struct {
|
||||
contentRenderCounter atomic.Uint64
|
||||
@@ -479,6 +497,7 @@ func (h *HugoSites) loadData() error {
|
||||
hugofs.WalkwayConfig{
|
||||
Fs: h.PathSpec.BaseFs.Data.Fs,
|
||||
IgnoreFile: h.SourceSpec.IgnoreFile,
|
||||
PathParser: h.Conf.PathParser(),
|
||||
WalkFn: func(path string, fi hugofs.FileMetaInfo) error {
|
||||
if fi.IsDir() {
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user