Fix image/gif properly

This commit is contained in:
Zed
2019-07-01 03:56:09 +02:00
parent a901e50df5
commit 1bae69e5b0
2 changed files with 14 additions and 5 deletions

View File

@@ -63,9 +63,9 @@
#
#proc renderMediaGroup(tweet: Tweet): string =
#let groups = if tweet.photos.len > 2: tweet.photos.distribute(2) else: @[tweet.photos]
#let display = if groups.len == 1 and groups[0].len == 1: "display: table-cell;" else: ""
#let class = if groups.len == 1 and groups[0].len == 1: "single-image" else: ""
#var first = true
<div class="attachments" style="${display}">
<div class="attachments ${class}">
#for photos in groups:
#let margin = if not first: "margin-top: .25em;" else: ""
#let flex = if photos.len > 1 or groups.len > 1: "display: flex;" else: ""