diff --git a/templates/components/thread-card-text.html b/templates/components/thread-card-text.html new file mode 100644 index 0000000..fe36304 --- /dev/null +++ b/templates/components/thread-card-text.html @@ -0,0 +1,8 @@ +{{ define "thread-card-text" }} + {{ $length := len . }} + {{ if gt $length 300 }} +
{{ slice . 0 300 }} ...
+ {{ else }} +{{ . }}
+ {{ end }} +{{ end }} \ No newline at end of file diff --git a/templates/components/thread-card-title.html b/templates/components/thread-card-title.html new file mode 100644 index 0000000..2d1f297 --- /dev/null +++ b/templates/components/thread-card-title.html @@ -0,0 +1,5 @@ +{{ define "thread-card-title" }} + {{ if ne . "" }} +{{ slice .Text 0 300 }} ...
- {{ else }} -{{.Text}}
- {{ end }} - + {{ template "thread-card-title" .Title }} + {{ template "thread-card-text" .Text }} Open