Aggiunto supporto per il markdown alle descrizioni degli item in storia e convertito a YAML
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package templates
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"html/template"
|
||||
"io"
|
||||
"log"
|
||||
@@ -23,7 +24,9 @@ func NewCacheTemplate(loadPatterns ...string) *CachedTemplate {
|
||||
PreLoadTemplatePatterns: loadPatterns,
|
||||
cachedTmpl: nil,
|
||||
}
|
||||
template.Must(cachedTemplate.Load(template.New("")))
|
||||
|
||||
template.Must(cachedTemplate.Load(nil))
|
||||
|
||||
return cachedTemplate
|
||||
}
|
||||
|
||||
@@ -33,7 +36,11 @@ func (ct *CachedTemplate) Load(t *template.Template) (*template.Template, error)
|
||||
return ct.cachedTmpl, nil
|
||||
}
|
||||
|
||||
ct.cachedTmpl = t
|
||||
ct.cachedTmpl = template.New("").Funcs(template.FuncMap{
|
||||
"raw": func(value any) template.HTML {
|
||||
return template.HTML(fmt.Sprint(value))
|
||||
},
|
||||
})
|
||||
|
||||
for _, pattern := range ct.PreLoadTemplatePatterns {
|
||||
var err error
|
||||
|
||||
Reference in New Issue
Block a user