From 7f5d5f40b1301f79a2bd8bc985e2455dffc3969b Mon Sep 17 00:00:00 2001 From: Arnas Udovic Date: Tue, 14 Feb 2023 16:44:03 +0200 Subject: [PATCH] remove space between file links; remove --- before links --- formatter.go | 2 +- templates/all_texts.gmi | 3 +-- templates/category.gmi | 5 ++--- templates/en/index.gmi | 3 +-- templates/macros.tpl | 3 ++- templates/search.gmi | 3 +-- templates/sgs/index.gmi | 3 +-- templates/tag.gmi | 3 +-- 8 files changed, 10 insertions(+), 15 deletions(-) diff --git a/formatter.go b/formatter.go index f8ff919..4ddaf92 100644 --- a/formatter.go +++ b/formatter.go @@ -37,7 +37,7 @@ func (fileContent *FileContent) FormatContent() string { } // append links to that paragraph if len(buffer) > 0 { - data = append(data, []byte("\n\n---\n")...) + data = append(data, []byte("\n")...) data = append(data, buffer...) } diff --git a/templates/all_texts.gmi b/templates/all_texts.gmi index 525fce7..e519e61 100644 --- a/templates/all_texts.gmi +++ b/templates/all_texts.gmi @@ -1,7 +1,6 @@ {% import "macros.tpl" category_url, tag_url, text_url, logo %} # {{ logo() }} Arna alkierios :: {% if lang == "sgs" %}Vėsė tekstā{% else %}All texts{% endif %} -{% for file in tree.Files %}{{ text_url(lang, file) }} -{% endfor %} +{% for file in tree.Files %}{{ text_url(lang, file) }} {% endfor %} => {% if lang == "sgs" %}/sgs ← grīžtė{% else %}/en ← back{% endif %} diff --git a/templates/category.gmi b/templates/category.gmi index fdfbdb1..e0e4270 100644 --- a/templates/category.gmi +++ b/templates/category.gmi @@ -3,11 +3,10 @@ {% if indexFile %}{{ indexFile.FormatContent()|safe }} -🌙 {{ indexFile.File.Created}} +🌙{{ indexFile.File.Created}} {{ indexFile.File.Copyright }}{% endif %} -{% for file in tree.RootFiles %}{% if file.Name != "index.md" %}{{ text_url(lang, file) }}{% endif %} -{% endfor %} +{% for file in tree.RootFiles %}{% if file.Name != "index.md" %}{{ text_url(lang, file) }}{% endif %}{% endfor %} {% if tree.Categories %}### {% if lang == "sgs" %}Kateguorėjės{% else %}Categories{% endif %} {% for cat, count in tree.Categories %}{{ category_url(lang, tree.Path|add:"/"|add:cat, cat, count) }} {% endfor %} {% endif %} diff --git a/templates/en/index.gmi b/templates/en/index.gmi index df2245b..dac6b16 100644 --- a/templates/en/index.gmi +++ b/templates/en/index.gmi @@ -22,7 +22,6 @@ Main themes are spreaded by categories. Each file may have tags what can filter {{ tag_url(lang, tag, count) }} {% endfor %} {% endif %} {% if lastFiles %}### Last texts -{% for file in lastFiles %} -{{ text_url(lang, file) }} {% endfor %} {% endif %} +{% for file in lastFiles %}{{ text_url(lang, file) }} {% endfor %} {% endif %} => /en/f all texts ({{ tree.Files|length }}) diff --git a/templates/macros.tpl b/templates/macros.tpl index ea23039..c7bd09e 100644 --- a/templates/macros.tpl +++ b/templates/macros.tpl @@ -2,6 +2,7 @@ {% macro tag_url(lang, tag, count) export %}=> /{{ lang }}/t/{{ tag }} 🏷 {{ tag }}{% if count %} ({{ count }}){% endif %} {% endmacro %} -{% macro text_url(lang, file) export %}=> /{{ lang }}/f/{{ file.CategoriesAsUrl() }}/{{ file.Id }}/{{ file.GmiName() }} ✒ {{ file.Description }} ({{ file.Created }}) {% endmacro %} +{% macro text_url(lang, file) export %}=> /{{ lang }}/f/{{ file.CategoriesAsUrl() }}/{{ file.Id }}/{{ file.GmiName() }} ✒ {{ file.Description }} ({{ file.Created }}) +{% endmacro %} {% macro logo() export %}🌛{% endmacro %} diff --git a/templates/search.gmi b/templates/search.gmi index 979db90..6e118c2 100644 --- a/templates/search.gmi +++ b/templates/search.gmi @@ -3,7 +3,6 @@ {% if lang == "sgs" %}Ėiškuota vagol{% else %}Searched by{% endif %}: {{ q }} {% if tree.Files|length == 0 %}{% if lang == "sgs" %}Nieka narada{% else %}Nothing found{% endif %}...{% else %} -{% for file in tree.Files %} -{{ text_url(lang, file) }} {% endfor %} {% endif %} +{% for file in tree.Files %}{{ text_url(lang, file) }} {% endfor %} {% endif %} => {% if lang == "sgs" %}/sgs ← grīžtė{% else %}/en ← back{% endif %} diff --git a/templates/sgs/index.gmi b/templates/sgs/index.gmi index 8394f25..acdc551 100644 --- a/templates/sgs/index.gmi +++ b/templates/sgs/index.gmi @@ -22,7 +22,6 @@ Pagrindėnės temas paskėrstītas par kateguorėjės. Kuožnos fails gal turie {{ tag_url(lang, tag, count) }} {% endfor %} {% endif %} {% if lastFiles %}### Paskotėnē īrašā -{% for file in lastFiles %} -{{ text_url(lang, file) }} {% endfor %} {% endif %} +{% for file in lastFiles %}{{ text_url(lang, file) }} {% endfor %} {% endif %} => /sgs/f vėsė straipsnē ({{ tree.Files|length }}) diff --git a/templates/tag.gmi b/templates/tag.gmi index 71ce497..69bf515 100644 --- a/templates/tag.gmi +++ b/templates/tag.gmi @@ -1,8 +1,7 @@ {% import "macros.tpl" category_url, tag_url, text_url, logo %} # {{ logo() }} Arna alkierios :: [{{ tag }}] -{% for file in tree.Files %}{{ text_url(lang, file) }} -{% endfor %} +{% for file in tree.Files %}{{ text_url(lang, file) }}{% endfor %} {% if tree.Tags %}### {% if lang == "sgs" %}Žīmas{% else %}Tags{% endif %} {% for tag, count in tree.Tags %}{{ tag_url(lang, tag, count) }} {% endfor %} {% endif %}