remove the reindent stuff. it does not matter

This commit is contained in:
rhiannon morris 2024-08-18 07:37:58 +02:00
parent 47d0d6a2cb
commit 7745722009
7 changed files with 123 additions and 238 deletions

View file

@ -66,7 +66,7 @@ make' root siteName prefix nsfw _dataDir dir
where path' = bigFile img
let prefetches = map makePrefetch otherImages
let makeWarning w = [b|@0
let makeWarning w = [b|
<figcaption id=cw aria-role=button tabindex=0>
<span id=cw-text>$w</span>
</figcaption>
@ -77,7 +77,7 @@ make' root siteName prefix nsfw _dataDir dir
let bgStyle = case bg of
Default -> ""
NoBorder -> [b|@0
NoBorder -> [b|
<style>
#mainfig {
background: transparent;
@ -86,7 +86,7 @@ make' root siteName prefix nsfw _dataDir dir
}
</style>
|]
Other col -> [b|@0
Other col -> [b|
<style> #mainfig { background: $col; } </style>
|]
@ -104,18 +104,18 @@ make' root siteName prefix nsfw _dataDir dir
let nsfwDialog = NsfwWarning.dialog nsfw'
let imageMeta = case previewImage info of
Just (PFull (Image {path})) -> [b|@0
Just (PFull (Image {path})) -> [b|
<meta property=og:image content="$url/$path">
<meta name=twitter:card content=summary_large_image>
<meta name=twitter:image content="$url/$path">
|]
Just (PThumb path) -> [b|@0
Just (PThumb path) -> [b|
<meta property=og:image content="$url/$path">
<meta name=twitter:card content=summary>
|]
Nothing -> throw $ NoThumb dir
pure [b|@0
pure [b|
<!DOCTYPE html>
<html lang=en>
<meta charset=utf-8>
@ -136,7 +136,7 @@ make' root siteName prefix nsfw _dataDir dir
$nsfwScript
$bgStyle
$0.prefetches
$prefetches
<title>$title</title>
@ -153,7 +153,7 @@ make' root siteName prefix nsfw _dataDir dir
</h2>
</header>
$2.buttonBar
$buttonBar
<main>
<figure id=mainfig>
@ -164,15 +164,15 @@ make' root siteName prefix nsfw _dataDir dir
</figure>
<div id=info>
$6.artistSection
$artistSection
$6.descSection
$descSection
$6.updatesList
$updatesList
$6.linksList
$linksList
$6.tagsList
$tagsList
</div>
</main>
</div>
@ -187,7 +187,7 @@ last' xs = if null xs then Nothing else Just $ last xs
makeArtist :: Maybe Artist -> Builder
makeArtist Nothing = ""
makeArtist (Just (Artist {name, url})) = [b|@0
makeArtist (Just (Artist {name, url})) = [b|
<section id=desc class=info-section>
<h2>by</h2>
<div>$artistLink</div>
@ -200,25 +200,25 @@ makeArtist (Just (Artist {name, url})) = [b|@0
makeDesc :: Desc -> Builder
makeDesc NoDesc = ""
makeDesc (TextDesc desc) = [b|@0
makeDesc (TextDesc desc) = [b|
<section id=desc class=info-section>
<h2>about</h2>
<div>
$4.desc
$desc
</div>
</section>
|]
makeDesc (LongDesc fs) = [b|@0
makeDesc (LongDesc fs) = [b|
<section id=desc class=info-section>
$2.fields
$fields
</section>
|]
where
fields = map makeField fs
makeField (DescField {name, text}) = [b|@0
makeField (DescField {name, text}) = [b|
<h2>$name</h2>
<div>
$4.text
$text
</div>
|]
@ -262,25 +262,25 @@ makeButtonBar title images =
makeNav "cat" $ fmap (uncurry makeCat) cats
where
makeNav :: CanBuild b => Text -> b -> Builder
makeNav cls inner = [b|@0
makeNav cls inner = [b|
<nav id=alts class=$cls aria-label="alternate versions">
$2.inner
$2.skipAll
$inner
$skipAll
</nav> |]
makeCat lbl imgs = [b|@0
makeCat lbl imgs = [b|
<section>
<h3 class=alt-cat>$lbl</h3>
$0.alts
$alts
</section> |]
where alts = makeAlts imgs
makeAlts imgs = [b|@0
makeAlts imgs = [b|
<ul class="buttonbar bb-choice">
$2.elems
$elems
</ul> |]
where elems = fmap (uncurry altButton) imgs
skipAll =
if any (isJust . (.warning) . fst) images then
[b|@0
[b|
<div class=buttonbar id=skipAllDiv>
<input type=checkbox name=skipAll id=skipAll>
<label for=skipAll>skip warnings</label>
@ -294,7 +294,7 @@ flatten =
fmap (\(t, is) -> fmap (\(i, _) -> i {label = t}) is)
altButton :: Image -> Text -> Builder
altButton img i = [b|@0
altButton img i = [b|
<li$nsfwClass>
<input type=radio name=variant id="$i" value="$path'"
data-link="$link"$warning'>
@ -310,11 +310,11 @@ altButton img i = [b|@0
makeTags :: FilePath -> [Strict.Text] -> Builder
makeTags undir tags =
if null tags then "" else [b|@0
if null tags then "" else [b|
<nav id=tags class=info-section>
<h2>tags</h2>
<ul>
$4.tagList
$tagList
</ul>
</nav>
|]
@ -325,18 +325,18 @@ makeTags undir tags =
extLinks :: [Link] -> Builder
extLinks links =
if null links then "" else [b|@0
if null links then "" else [b|
<nav id=links class=info-section>
<h2>links</h2>
<ul>
$4.linkList
$linkList
</ul>
</nav>
|]
where linkList = map extLink links
extLink :: Link -> Builder
extLink (Link {title, url}) = [b|@8
extLink (Link {title, url}) = [b|
<li>
<a href="$url">
$title
@ -345,18 +345,18 @@ extLink (Link {title, url}) = [b|@8
makeUpdates :: [(Date, NonEmpty Update)] -> Builder
makeUpdates ups =
if all (null . snd) ups then "" else [b|@4
if all (null . snd) ups then "" else [b|
<section id=updates class=info-section>
<h2>updates</h2>
<dl>
$8.updateList
$updateList
</dl>
</section>
|]
where updateList = fmap (uncurry makeUpdate) ups
makeUpdate :: Date -> NonEmpty Update -> Builder
makeUpdate date ups = [b|@8
makeUpdate date ups = [b|
<dt>$date'
<dd>$desc
|] where