diff --git a/src/html.go b/src/html.go index e367ee8..a1fa505 100644 --- a/src/html.go +++ b/src/html.go @@ -1,7 +1,9 @@ package src import ( + "fmt" "html/template" + "strings" "github.com/klausbreyer/grr" ) @@ -97,13 +99,15 @@ type DataBook struct { } func getBook(data DataBook) template.HTML { + // Erstellen Sie die eigene Variable und entfernen Sie alle ":" + titleStr := strings.ReplaceAll(fmt.Sprintf("%s, %s, %d", data.Book.Title, data.Book.Author, data.Book.FirstHighlightYear), ":", "") + return grr.Render(` #{{.BookIndex}} -

{{.Book.Title}}, {{.Book.Author}}, {{.Book.FirstHighlightYear}}

+

{{.TitleStr}}

{{.Book.SourceURL}} - » + »»»
@@ -111,10 +115,12 @@ func getBook(data DataBook) template.HTML { Book Book BookIndex int Highlights template.HTML + TitleStr string }{ data.Book, data.BookIndex, getHighlights(data.Book.Highlights), + titleStr, }) }