mirror of
https://github.com/zedeus/nitter
synced 2026-09-05 22:59:31 +00:00
Use webp for thumbnails when available
This commit is contained in:
parent
88c6135030
commit
cd163b26a3
3 changed files with 13 additions and 14 deletions
|
|
@ -3,6 +3,14 @@ import strutils, strformat
|
|||
import karax/[karaxdsl, vdom, vstyles]
|
||||
import ".."/[types, utils]
|
||||
|
||||
const smallWebp* = "?name=small&format=webp"
|
||||
|
||||
proc getSmallPic*(url: string): string =
|
||||
result = url
|
||||
if "?" notin url and not url.endsWith("placeholder.png"):
|
||||
result &= smallWebp
|
||||
result = getPicUrl(result)
|
||||
|
||||
proc icon*(icon: string; text=""; title=""; class=""; href=""): VNode =
|
||||
var c = "icon-" & icon
|
||||
if class.len > 0: c = &"{c} {class}"
|
||||
|
|
|
|||
Loading…
Reference in a new issue