add gallery description
This commit is contained in:
parent
c10a3ab340
commit
c2f991bc3e
2 changed files with 7 additions and 5 deletions
|
@ -50,8 +50,8 @@ make' (IndexInfo {title, galleries, links, footer}) = [b|@0
|
|||
|]
|
||||
|
||||
makeItem :: GalleryInfo -> Builder
|
||||
makeItem (GalleryInfo {title, prefix, filters}) = [b|@4
|
||||
<li$nsfw><a href=$@prefix>$*title</a>
|
||||
makeItem (GalleryInfo {title, description, prefix, filters}) = [b|@4
|
||||
<li$nsfw><a href=$@prefix title="$*description">$*title</a>
|
||||
|]
|
||||
where nsfw = if hasNsfw filters then " class=nsfw" else ""
|
||||
|
||||
|
|
|
@ -148,6 +148,7 @@ instance FromYAML Link where
|
|||
data GalleryInfo =
|
||||
GalleryInfo {
|
||||
title :: !Text,
|
||||
description :: !Text,
|
||||
prefix :: !FilePath,
|
||||
filters :: !GalleryFilters
|
||||
}
|
||||
|
@ -189,6 +190,7 @@ matchFilters (GalleryFilters {nsfw, whose}) i =
|
|||
instance FromYAML GalleryInfo where
|
||||
parseYAML = YAML.withMap "gallery info" \m ->
|
||||
GalleryInfo <$> m .: "title"
|
||||
<*> m .: "description"
|
||||
<*> m .: "prefix"
|
||||
<*> m .:? "filters" .!= noFilters
|
||||
|
||||
|
|
Loading…
Reference in a new issue