diff --git a/make-pages/Info.hs b/make-pages/Info.hs index ce2c69b..f2a158c 100644 --- a/make-pages/Info.hs +++ b/make-pages/Info.hs @@ -27,7 +27,7 @@ data Info = nsfwTags :: ![Text], description :: !(Maybe Text), images :: ![Image], - thumb :: !(Maybe Text), + thumb :: !(Maybe FilePath), links :: ![Link] } deriving (Eq, Show) @@ -42,7 +42,7 @@ data Artist = data Image = Image { label :: !Text, - path :: !Text, + path :: !FilePath, nsfw :: !Bool } deriving (Eq, Show) @@ -129,3 +129,6 @@ instance FromYAML Day where case readMaybe $ Text.unpack str of Just d -> pure d Nothing -> fail $ "couldn't parse date " ++ show str + +instance {-# OVERLAPPING #-} FromYAML String where + parseYAML y = Text.unpack <$> parseYAML y diff --git a/make-pages/SinglePage.hs b/make-pages/SinglePage.hs index 3c450b2..a942caf 100644 --- a/make-pages/SinglePage.hs +++ b/make-pages/SinglePage.hs @@ -43,7 +43,7 @@ make' nsfw (Info {date, title, artist, tags, nsfwTags,
- + $descSection @@ -66,7 +66,7 @@ make' nsfw (Info {date, title, artist, tags, nsfwTags, formattedDate = formatDate date - buttonBar = makeButtonBar (fromMaybe path0 title) nsfw images + buttonBar = makeButtonBar (fromMaybe (Strict.pack path0) title) nsfw images path0 = #path $ head images descSection = ifJust description makeDesc @@ -117,7 +117,7 @@ altButton :: Int -> Image -> Builder altButton i (Image {label, path, nsfw}) = [b|@6 + autocomplete=off value="$@path"> |] where diff --git a/make-pages/make-pages.cabal b/make-pages/make-pages.cabal index 9a76ed1..90d14ba 100644 --- a/make-pages/make-pages.cabal +++ b/make-pages/make-pages.cabal @@ -17,12 +17,14 @@ executable make-pages DeriveAnyClass, DerivingStrategies, DuplicateRecordFields, + FlexibleInstances, LambdaCase, NamedFieldPuns, OverloadedLabels, OverloadedStrings, PatternSynonyms, QuasiQuotes, + TypeSynonymInstances, ViewPatterns build-depends: base >= 4.12.0.0 && < 4.15,