format content
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Arnas Udovicius 2022-08-23 13:20:07 +03:00
parent 833ce18b0a
commit c19094ca90
3 changed files with 13 additions and 2 deletions

View file

@ -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 {

View file

@ -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 %}

View file

@ -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 }}