From 177bdba33160c2d2ad9d7a50cbeeae1e1646d966 Mon Sep 17 00:00:00 2001 From: rhiannon morris Date: Sun, 18 Aug 2024 08:59:29 +0200 Subject: [PATCH] i broke rss :o --- make-pages/BuilderQQ.hs | 3 ++- make-pages/RSS.hs | 24 ++++++++++++------------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/make-pages/BuilderQQ.hs b/make-pages/BuilderQQ.hs index e9633ad..c7cee73 100644 --- a/make-pages/BuilderQQ.hs +++ b/make-pages/BuilderQQ.hs @@ -19,7 +19,8 @@ import Data.List.NonEmpty (NonEmpty, toList) data Chunk = Lit String | Var String parseB :: String -> ExpQ -parseB = toExpQ . reverse . go "" [] . dropWhileEnd isSpace where +parseB = toExpQ . reverse . go "" [] . trim where + trim = dropWhileEnd isSpace . dropWhile (== '\n') go acc cs [] = addLit acc cs go acc cs ('$':'&':rest) = go acc cs rest -- $&: expands to nothing go acc cs ('$':'$':rest) = go ('$' : acc) cs rest -- $$: expands to one $ diff --git a/make-pages/RSS.hs b/make-pages/RSS.hs index dfa0e0e..3739cda 100644 --- a/make-pages/RSS.hs +++ b/make-pages/RSS.hs @@ -25,18 +25,18 @@ make root name ginfo output infos = make' :: Strict.Text -> Strict.Text -> GalleryInfo -> Maybe FilePath -> [(FilePath, Info)] -> Builder make' root name ginfo@(GalleryInfo {title, desc, prefix}) output infos = [b| - - - - $name—$title - $link - $desc - $selflink + + + + $name—$title + $link + $desc + $selflink - $items - - - |] + $items + + +|] where link = [b|$root/$prefix|] nsfw = ginfo.nsfw @@ -45,7 +45,7 @@ make' root name ginfo@(GalleryInfo {title, desc, prefix}) output infos = [b| filter (not . (.unlisted) . snd) infos selflink = case output of Nothing -> "" - Just o -> [b||] + Just o -> [b||] makeItem :: Strict.Text -> FilePath -> Bool -> FilePath -> Info -> Builder makeItem root prefix nsfw path info@(Info {title}) = [b|