add resize: false for stuff like animated webps

This commit is contained in:
rhiannon morris 2024-08-05 19:08:36 +02:00
parent 1307cce488
commit 929cc1dc3f
3 changed files with 24 additions and 24 deletions

View file

@ -52,10 +52,8 @@ make' root siteName prefix nsfw _dataDir dir
let buttonBar = makeButtonBar title $ addIds images
let image0 :| otherImages = allImages images
let Image {path = path0, download = download0'} = image0
let download0 = fromMaybe (bigFile path0) download0'
let path0' = pageFile path0
let download0 = fromMaybe (bigFile image0) image0.download
let path0' = pageFile image0
let artistSection = makeArtist artist
let descSection = makeDesc $ descFor nsfw info
@ -64,8 +62,8 @@ make' root siteName prefix nsfw _dataDir dir
let updates = sort $ updatesFor nsfw info
let updatesList = makeUpdates updates
let makePrefetch (Image {path}) = [b|<link rel=prefetch href=$path'>|]
where path' = bigFile path
let makePrefetch img = [b|<link rel=preload as=image href=$path'>|]
where path' = bigFile img
let prefetches = map makePrefetch otherImages
let makeWarning w = [b|@0
@ -309,11 +307,11 @@ altButton img i = [b|@0
<label for="$i"$nsfwLabelClass>$label</label>
|]
where
Image {label, path, nsfw, warning, download} = img
Image {label, nsfw, warning, download} = img
nsfwClass = if nsfw then [b| class=nsfw|] else ""
nsfwLabelClass = if nsfw then [b| class=nsfw-label|] else ""
path' = pageFile path
link = fromMaybe (bigFile path) download
path' = pageFile img
link = fromMaybe (bigFile img) download
warning' = ifJust warning \(escAttr -> w) -> [b| data-warning="$w"|]
makeTags :: FilePath -> [Strict.Text] -> Builder