diff --git a/make-pages/GalleryPage.hs b/make-pages/GalleryPage.hs index 1d0a175..b116769 100644 --- a/make-pages/GalleryPage.hs +++ b/make-pages/GalleryPage.hs @@ -2,7 +2,7 @@ module GalleryPage (make) where import Control.Exception -import Data.Function (on) +import Data.Function (on, (&)) import Data.List (sortOn, groupBy) import qualified Data.Text.Lazy as Lazy import System.FilePath ((), takeDirectory) @@ -27,7 +27,8 @@ make' title nsfw infos = [b|@0 - + + $*title @@ -61,14 +62,16 @@ makeYearItems :: Bool -- ^ nsfw -> Builder makeYearItems nsfw year infos = [b|@4
  • - $^year + $year' $4.items |] - where items = map (uncurry $ makeItem nsfw) infos + where + items = map (uncurry $ makeItem nsfw) infos + year' = show year & foldMap \c -> [b|$'c|] makeItem :: Bool -> FilePath -> Info -> Builder makeItem nsfw file info@(Info {title}) = [b|@4 -
  • +
  • @@ -79,5 +82,4 @@ makeItem nsfw file info@(Info {title}) = [b|@4 where dir = takeDirectory file thumb = maybe (throw $ NoThumb dir) (\t -> dir thumbFile t) $ #thumb info - cls | nsfw && #anyNsfw info = [b|class="item nsfw"|] - | otherwise = [b|class=item|] + nsfw' = if nsfw && #anyNsfw info then " nsfw" else "" diff --git a/make-pages/IndexPage.hs b/make-pages/IndexPage.hs index 775f3a0..d17dd45 100644 --- a/make-pages/IndexPage.hs +++ b/make-pages/IndexPage.hs @@ -13,7 +13,8 @@ make' (IndexInfo {title, galleries, links, footer}) = [b|@0 - + + $*title @@ -30,13 +31,13 @@ make' (IndexInfo {title, galleries, links, footer}) = [b|@0 |] where galleryList = if null galleries then "" else [b|@2 -