Add template file for previous commit
This commit is contained in:
parent
47d206666b
commit
09356ecc04
@ -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}}
|
Loading…
x
Reference in New Issue
Block a user