correction bug empty html

This commit is contained in:
github_username_here
2026-03-30 16:01:48 +02:00
parent 94dfe07839
commit 7a7129ec29
4 changed files with 562 additions and 8 deletions

View File

@@ -8,7 +8,7 @@
<title>Comprendre et chanter les Psaumes</title>
<link rel="stylesheet" href="css/automatic.css">
<link rel=stylesheet" href="css/automatic-token.css">
<link rel="stylesheet" href="css/automatic-token.css">
<link rel="stylesheet" href="css/psalm.css">
<!--

View File

@@ -32,14 +32,17 @@ func ExtractChapter(cfg *config.Cfg, chapterNum int) (error){
}
var psalm models.Psalm
currentStrophe := models.Strophe{
Who: yamlData.PoeticLines[0].Who,
To: yamlData.PoeticLines[0].To,
Of: yamlData.PoeticLines[0].Of,
}
var currentStrophe models.Strophe
for _, poeticLine := range yamlData.PoeticLines{
for i, poeticLine := range yamlData.PoeticLines{
log.Printf("first line: %v - %v - %v", poeticLine.Who, poeticLine.To, poeticLine.Of)
if i == 0 {
currentStrophe = models.Strophe{
Who: yamlData.PoeticLines[0].Who,
To: yamlData.PoeticLines[0].To,
Of: yamlData.PoeticLines[0].Of,
}
}
if poeticLine.Who == currentStrophe.Who &&
poeticLine.To == currentStrophe.To &&
@@ -58,6 +61,7 @@ func ExtractChapter(cfg *config.Cfg, chapterNum int) (error){
}
psalm.Strophes = append(psalm.Strophes, currentStrophe)
log.Printf("====== %v %v========", psalm.Strophes, chapterNum)
tmpl := template.Must(template.ParseFiles( "internal/models/index.html", "internal/models/psalm.html"))
outputFileName := path.Join(cfg.HtmlPath, cfg.Book.Name + strconv.Itoa(chapterNum) + ".html")
@@ -69,7 +73,7 @@ func ExtractChapter(cfg *config.Cfg, chapterNum int) (error){
defer outputFile.Close()
tmpl.ExecuteTemplate(outputFile, "index.html", psalm.Strophes)
tmpl.Execute(outputFile, psalm.Strophes)
log.Printf("%v", psalm)
return nil