mastodon-markdown-archive/files/templates/post.tmpl
Gabriel Garrido 5af659241f Updates to threading, structs, and template
* Extend Mastodon structs
* Make threading optional
* Include tags in default template
* Add function to get all tags
* Update spacing in template
* Update default template front-matter
2024-05-12 11:46:31 +02:00

36 lines
702 B
Cheetah

---
date: {{ .Post.CreatedAt }}
{{- if .Post.InReplyToId }}
in_reply_to: {{ .Post.InReplyToId }}
{{- end }}
post_uri: {{ .Post.URI }}
post_id: {{ .Post.Id }}
{{- if len .Tags }}
tags:
{{- range .Tags }}
- {{ .Name }}
{{- end }}
{{- end }}
{{- if len .Descendants }}
descendants:
{{- range .Descendants }}
- {{ .Id }}
{{- end }}
{{- end }}
---
{{ .Post.Content | tomd }}
{{- range .Post.MediaAttachments }}
{{ if eq .Type "image" }}
![{{ .Description }}]({{ .Path }})
{{ end }}
{{- end -}}
{{- range .Descendants }}
{{ .Content | tomd -}}
{{- range .MediaAttachments }}
{{ if eq .Type "image" }}
![{{ .Description }}]({{ .Path }})
{{ end }}
{{- end -}}
{{- end -}}