Compare commits

...

3 Commits

Author SHA1 Message Date
rra 658a4ddfac Merge pull request 'add support for videos in posts from social' (#60) from r/lumbung.space:main into main
continuous-integration/drone/push Build is passing Details
Reviewed-on: #60
2022-09-09 13:31:40 +02:00
rra 14eb01e513 Merge branch 'main' into main 2022-09-09 13:31:05 +02:00
rra 79b038fea3 add support for videos in posts from social 2022-09-09 13:23:33 +02:00
1 changed files with 12 additions and 4 deletions

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 }}