Add template file for previous commit

This commit is contained in:
Alessio 2023-08-27 15:49:26 -03:00
parent 47d206666b
commit 09356ecc04

View File

@ -0,0 +1,18 @@
{{define "text-with-entities"}}
{{range (splitList "\n" .)}}
<p class="text" hx-trigger="click consume">
{{range (get_entities .)}}
{{if (eq .EntityType 1)}}
<!-- Mention -->
<a class="entity" href="/{{.Contents}}">@{{.Contents}}</a>
{{else if (eq .EntityType 2)}}
<!-- Hashtag -->
<a class="entity" href="/search/%23{{.Contents}}">#{{.Contents}}</a>
{{else}}
<!-- Just text -->
{{.Contents}}
{{end}}
{{end}}
</p>
{{end}}
{{end}}