mirror of
https://github.com/acaloiaro/garbagespeak.com
synced 2026-07-22 02:36:56 +00:00
Refactor tags and post links
This commit is contained in:
parent
3223df4dfb
commit
f838799ac9
1 changed files with 14 additions and 10 deletions
|
|
@ -2,25 +2,17 @@
|
||||||
{{ $apiBaseURL := .ApiBaseUrl }}
|
{{ $apiBaseURL := .ApiBaseUrl }}
|
||||||
{{range .Posts}}
|
{{range .Posts}}
|
||||||
<article class="post on-list">
|
<article class="post on-list">
|
||||||
<h1 class="post-title"><a href={{ .Url }}>{{ .Title }} {{if .Url}}(link){{end}}</a></h1>
|
<h1 class="post-title">{{ .Title }}</h1>
|
||||||
<div class="post-meta">
|
<div class="post-meta">
|
||||||
{{- with .Username -}}
|
{{- with .Username -}}
|
||||||
<span>Submitter: {{ . }}</span>
|
<span>Submitter: {{ . }}</span>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{ if .Metadata.tags }}
|
|
||||||
<span>
|
|
||||||
{{ range .Metadata.tags }}
|
|
||||||
{{- . -}},
|
|
||||||
{{ end }}
|
|
||||||
</span>
|
|
||||||
{{ end }}
|
|
||||||
|
|
||||||
{{- with .CreatedAt -}}
|
{{- with .CreatedAt -}}
|
||||||
<time class="post-date">
|
<time class="post-date">
|
||||||
{{- .Format "2006-01-02" -}}
|
{{- .Format "2006-01-02" -}}
|
||||||
</time>
|
</time>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
{{if .Url}}<a href={{ .Url }}>Link</a>{{ end }}
|
||||||
{{ if eq .OwnerID.String $.UserID }}
|
{{ if eq .OwnerID.String $.UserID }}
|
||||||
<a href="#"
|
<a href="#"
|
||||||
hx-get="{{ $apiBaseURL }}/garbage/{{ .ID }}/edit"
|
hx-get="{{ $apiBaseURL }}/garbage/{{ .ID }}/edit"
|
||||||
|
|
@ -33,6 +25,18 @@
|
||||||
<div class="post-content">
|
<div class="post-content">
|
||||||
{{ .Content }}
|
{{ .Content }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
<div class="post-meta">
|
||||||
|
{{ if .Metadata.tags }}
|
||||||
|
<span>tags</span>
|
||||||
|
<span>
|
||||||
|
{{ range .Metadata.tags }}
|
||||||
|
{{- . -}},
|
||||||
|
{{ end }}
|
||||||
|
</span>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
</article>
|
</article>
|
||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue