adding automatic.css
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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}}
|
||||
|
||||
@@ -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("can’t create %v", outputFileName)
|
||||
}
|
||||
defer outputFile.Close()
|
||||
|
||||
|
||||
tmpl.ExecuteTemplate(outputFile, "index.html", psalm.Strophes)
|
||||
log.Printf("%v", psalm)
|
||||
return nil
|
||||
|
||||
|
||||
Reference in New Issue
Block a user