This commit is contained in:
parent
833ce18b0a
commit
c19094ca90
3 changed files with 13 additions and 2 deletions
11
formatter.go
11
formatter.go
|
@ -7,6 +7,17 @@ import (
|
|||
"strings"
|
||||
)
|
||||
|
||||
func (fileContent *FileContent) FormatContent() string {
|
||||
content := fileContent.Content
|
||||
badChars := make(map[string]string)
|
||||
badChars["'"] = "'"
|
||||
for k, v := range badChars {
|
||||
content = strings.ReplaceAll(content, k, v)
|
||||
}
|
||||
|
||||
return content
|
||||
}
|
||||
|
||||
func (file *TreeFile) CategoriesAsUrl() string {
|
||||
escapedCategories := []string{}
|
||||
for _, c := range file.Category {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{% import "macros.tpl" category_url, tag_url, text_url, logo %}
|
||||
# {{ logo() }} Arna alkierios :: {{ path }}
|
||||
|
||||
{% if indexFile %}{{ indexFile.Content }}
|
||||
{% if indexFile %}{{ indexFile.FormatContent() }}
|
||||
|
||||
🌙 {{ indexFile.File.Created}}
|
||||
{{ indexFile.File.Copyright }}{% endif %}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{% import "macros.tpl" category_url, tag_url, text_url, logo %}
|
||||
# {{ logo() }} Arna alkierios :: {{ file.File.Description }}
|
||||
|
||||
{{ file.Content }}
|
||||
{{ file.FormatContent() }}
|
||||
|
||||
🌙 {{ file.File.Created}}
|
||||
{{ file.File.Copyright }}
|
||||
|
|
Loading…
Reference in a new issue