correction yaml creation - extraction yaml + html preparation
This commit is contained in:
15
internal/models/index.html
Normal file
15
internal/models/index.html
Normal file
@@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<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)">
|
||||
|
||||
<title>Comprendre et chanter les Psaumes</title>
|
||||
|
||||
<link rel="stylesheet" href="css/style.css">
|
||||
|
||||
<link rel="icon" href="favicon.ico" type="image/x-icon">
|
||||
</head>
|
||||
<body>{{template "content" .}} </body>
|
||||
</html>
|
||||
19
internal/models/psalm.html
Normal file
19
internal/models/psalm.html
Normal file
@@ -0,0 +1,19 @@
|
||||
{{define "content"}}
|
||||
<section class="psalm">
|
||||
<div class="psalm__inner">
|
||||
<ul class="psalm__strophs">
|
||||
{{range .Strophes}}
|
||||
<li class="psalm__strophe" data-who="{{.Who}}" data-to="{{.To}}" data-of="{{.Of}}">
|
||||
{{range .Lines}}
|
||||
<ul class="psalm__lines">
|
||||
{{range .}}
|
||||
<li class="line" data-verse="{{.Number}}">{{.Text}}</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
{{end}}
|
||||
</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
{{end}}
|
||||
@@ -1,17 +1,28 @@
|
||||
package models
|
||||
|
||||
type Yaml struct {
|
||||
Strophes []Strophe `yaml:"strophes"`
|
||||
PoeticLines []PoeticLine `yaml:"poetic-lines"`
|
||||
}
|
||||
|
||||
type Strophe struct {
|
||||
Lines []Line `yaml:"lines"`
|
||||
}
|
||||
|
||||
type Line struct {
|
||||
Verse int `yaml:"verse"`
|
||||
Text string `yaml:"text"`
|
||||
type PoeticLine struct {
|
||||
Cola []Colon `yaml:"cola"`
|
||||
Who string `yaml:"who"`
|
||||
To string `yaml:"to"`
|
||||
Of string `yaml:"Of"`
|
||||
Of string `yaml:"of"`
|
||||
}
|
||||
|
||||
type Colon struct {
|
||||
Verse int `yaml:"verse"`
|
||||
Text string `yaml:"text"`
|
||||
}
|
||||
|
||||
type Strophe struct {
|
||||
Who string
|
||||
To string
|
||||
Of string
|
||||
Colas [][]Colon
|
||||
}
|
||||
|
||||
type Psalm struct {
|
||||
Strophes []Strophe
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user