add title to index.yaml
This commit is contained in:
parent
eecb750059
commit
980d790874
2 changed files with 7 additions and 5 deletions
|
@ -7,19 +7,19 @@ import BuilderQQ
|
||||||
import Info
|
import Info
|
||||||
|
|
||||||
make :: IndexInfo -> Lazy.Text
|
make :: IndexInfo -> Lazy.Text
|
||||||
make iinfo = toLazyText $ make' iinfo
|
make info = toLazyText $ make' info
|
||||||
|
|
||||||
make' :: IndexInfo -> Builder
|
make' :: IndexInfo -> Builder
|
||||||
make' (IndexInfo {galleries, footer}) = [b|@0
|
make' (IndexInfo {title, galleries, footer}) = [b|@0
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang=en>
|
<html lang=en>
|
||||||
<meta charset=utf-8>
|
<meta charset=utf-8>
|
||||||
<link rel=stylesheet href=/style/index.css>
|
<link rel=stylesheet href=/style/index.css>
|
||||||
|
|
||||||
<title>gallery list</title>
|
<title>$*title</title>
|
||||||
|
|
||||||
<header>
|
<header>
|
||||||
<h1>gallery list</h1>
|
<h1>$*title</h1>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<main>
|
<main>
|
||||||
|
|
|
@ -198,6 +198,7 @@ instance FromYAML Whose where parseYAML = YAML.withStr "whose" readWhose
|
||||||
|
|
||||||
data IndexInfo =
|
data IndexInfo =
|
||||||
IndexInfo {
|
IndexInfo {
|
||||||
|
title :: !Text,
|
||||||
galleries :: ![GalleryInfo],
|
galleries :: ![GalleryInfo],
|
||||||
footer :: !Text
|
footer :: !Text
|
||||||
}
|
}
|
||||||
|
@ -205,7 +206,8 @@ data IndexInfo =
|
||||||
|
|
||||||
instance FromYAML IndexInfo where
|
instance FromYAML IndexInfo where
|
||||||
parseYAML = YAML.withMap "index info" \m ->
|
parseYAML = YAML.withMap "index info" \m ->
|
||||||
IndexInfo <$> m .:? "galleries" .!= []
|
IndexInfo <$> m .: "title"
|
||||||
|
<*> m .:? "galleries" .!= []
|
||||||
<*> m .:? "footer" .!= ""
|
<*> m .:? "footer" .!= ""
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue