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"
|
"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 {
|
func (file *TreeFile) CategoriesAsUrl() string {
|
||||||
escapedCategories := []string{}
|
escapedCategories := []string{}
|
||||||
for _, c := range file.Category {
|
for _, c := range file.Category {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{% import "macros.tpl" category_url, tag_url, text_url, logo %}
|
{% import "macros.tpl" category_url, tag_url, text_url, logo %}
|
||||||
# {{ logo() }} Arna alkierios :: {{ path }}
|
# {{ logo() }} Arna alkierios :: {{ path }}
|
||||||
|
|
||||||
{% if indexFile %}{{ indexFile.Content }}
|
{% if indexFile %}{{ indexFile.FormatContent() }}
|
||||||
|
|
||||||
🌙 {{ indexFile.File.Created}}
|
🌙 {{ indexFile.File.Created}}
|
||||||
{{ indexFile.File.Copyright }}{% endif %}
|
{{ indexFile.File.Copyright }}{% endif %}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{% import "macros.tpl" category_url, tag_url, text_url, logo %}
|
{% import "macros.tpl" category_url, tag_url, text_url, logo %}
|
||||||
# {{ logo() }} Arna alkierios :: {{ file.File.Description }}
|
# {{ logo() }} Arna alkierios :: {{ file.File.Description }}
|
||||||
|
|
||||||
{{ file.Content }}
|
{{ file.FormatContent() }}
|
||||||
|
|
||||||
🌙 {{ file.File.Created}}
|
🌙 {{ file.File.Created}}
|
||||||
{{ file.File.Copyright }}
|
{{ file.File.Copyright }}
|
||||||
|
|
Loading…
Reference in a new issue