forked from ruangrupa/lumbung.space
add support for videos in posts from social
This commit is contained in:
parent
2c684611c4
commit
79b038fea3
@ -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}}
|
||||
@ -18,9 +25,10 @@
|
||||
<div class="summary-image {{if gt $ratio 1 }} portrait {{else}} landscape {{end}}">
|
||||
<a href="{{ $postPermalink }}"><img src="{{ $thumb.Permalink }}" alt="{{ .Title }}"> </a>
|
||||
</div>
|
||||
{{ else }}
|
||||
{{ else }}
|
||||
<div class="p-summary">
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<div class="summary-text">
|
||||
{{ .Summary }}
|
||||
</div>
|
||||
@ -32,10 +40,10 @@
|
||||
<span class="from p-author">{{ if .Params.authors }}From {{range .Params.authors}}<b> <a href='{{ "/authors/" | relLangURL }}{{ . | urlize }}/'> {{ . }}</a> {{end}}</b> on{{ end }}</span>
|
||||
<time class="dt-published" datetime="{{ .Date.Format `Jan 02 2006` }}">{{ .Date.Format "Jan 02, 2006" }}</time>
|
||||
</div>
|
||||
{{ if .Truncated }}
|
||||
{{ if .Truncated }}
|
||||
<div class="footer-filler"></div>
|
||||
<div class='read-more'><a href="{{ .RelPermalink }}">Read More…</a></div>
|
||||
{{ end }}
|
||||
</footer>
|
||||
</footer>
|
||||
</article>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user