adding automatic.css

This commit is contained in:
github_username_here
2026-03-24 18:37:31 +01:00
parent f7e63ce1e1
commit 3be21b99e4
7 changed files with 179 additions and 8 deletions

View File

@@ -3,13 +3,16 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Your short site description (for SEO)">
<meta name="description" content="Mieux voir la structure des Psaumes pour mieux les comprendre et pour mieux les chanter">
<title>Comprendre et chanter les Psaumes</title>
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/automatic.css">
<link rel="stylesheet" href="css/psalm.css">
<!--
<link rel="icon" href="favicon.ico" type="image/x-icon">
-->
</head>
<body>{{template "content" .}} </body>
</html>

View File

@@ -2,12 +2,12 @@
<section class="psalm">
<div class="psalm__inner">
<ul class="psalm__strophs">
{{range .Strophes}}
{{range .}}
<li class="psalm__strophe" data-who="{{.Who}}" data-to="{{.To}}" data-of="{{.Of}}">
{{range .Lines}}
{{range .Colas}}
<ul class="psalm__lines">
{{range .}}
<li class="line" data-verse="{{.Number}}">{{.Text}}</li>
<li class="line" data-verse="{{.Verse}}">{{.Text}}</li>
{{end}}
</ul>
{{end}}

View File

@@ -3,6 +3,7 @@ import (
"log"
"project.hechon.fr/internal/config"
"project.hechon.fr/internal/models"
"html/template"
"gopkg.in/yaml.v3"
"os"
"path"
@@ -46,15 +47,29 @@ func ExtractChapter(cfg *config.Cfg, chapterNum int) (error){
currentStrophe.Colas = append(currentStrophe.Colas, poeticLine.Cola)
}else{
psalm.Strophes = append(psalm.Strophes, currentStrophe)
currentStrophe.Who = poeticLine.Who
currentStrophe.Of = poeticLine.Of
currentStrophe.To = poeticLine.To
currentStrophe = models.Strophe{
Who: poeticLine.Who,
To: poeticLine.To,
Of: poeticLine.Of,
Colas: [][]models.Colon{poeticLine.Cola},
}
}
}
psalm.Strophes = append(psalm.Strophes, currentStrophe)
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")
outputFile, err := os.Create(outputFileName)
if err!= nil {
return fmt.Errorf("cant create %v", outputFileName)
}
defer outputFile.Close()
tmpl.ExecuteTemplate(outputFile, "index.html", psalm.Strophes)
log.Printf("%v", psalm)
return nil