add support for videos in posts from social #60

Merged
r merged 2 commits from r/lumbung.space:main into main 2022-09-09 11:31:41 +00:00
Showing only changes of commit 79b038fea3 - Show all commits

View File

@ -10,6 +10,13 @@
</a></h2>
</header>
{{ with (index (.Resources.ByType "video") 0) }}
{{/* TODO this current logic does not suport video & image mixed */}}
<div class="p-summary">
<video controls width="540px" preload="none" poster="{{ $postPermalink }}/thumbnail.png">
<source src="{{.Permalink}}" type="video/mp4">
</video>
{{ else}}
{{ with (index (.Resources.ByType "image") 0) }}
{{ $height := add .Height 0.0}}
{{ $ratio := div $height .Width}}
@ -20,6 +27,7 @@
</div>
{{ else }}
<div class="p-summary">
{{ end }}
{{ end }}
<div class="summary-text">
{{ .Summary }}