Fix Wiki Generation Not Running

This commit is contained in:
2026-05-22 09:38:46 +02:00
parent e6fdcdec87
commit f4d92a9766
3 changed files with 84 additions and 2 deletions
+18 -1
View File
@@ -136,7 +136,7 @@ func buildWiki(p *project.Project, nativeResult BuildResult, force bool, progres
}
state, _ := loadWikiState(statePath)
if !force && digest != "" && state.Digest == digest {
if !force && digest != "" && state.Digest == digest && wikiCachedPagesAreCurrent(outputDir, state) {
return wikiResult{
OutputDir: outputDir,
PageCount: state.Pages,
@@ -248,6 +248,23 @@ func buildWiki(p *project.Project, nativeResult BuildResult, force bool, progres
}, nil
}
func wikiCachedPagesAreCurrent(outputDir string, state wikiStateDocument) bool {
if state.Pages <= 0 {
return false
}
count := 0
err := filepath.WalkDir(outputDir, func(path string, d fs.DirEntry, err error) error {
if err != nil {
return err
}
if !d.IsDir() && strings.EqualFold(filepath.Ext(path), ".html") {
count++
}
return nil
})
return err == nil && count == state.Pages
}
func loadWikiManualSections(p *project.Project) []wikiManualSection {
defaults := defaultWikiManualSections()
cfg := p.EffectiveConfig().TopData.Wiki