aboutsummaryrefslogtreecommitdiff
path: root/site.hs
diff options
context:
space:
mode:
Diffstat (limited to 'site.hs')
-rw-r--r--site.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/site.hs b/site.hs
index 918fdff..e012f04 100644
--- a/site.hs
+++ b/site.hs
@@ -348,13 +348,17 @@ renderTags = use (htags . to M.keys) >>= traverse_ renderTag
-- | Transform one mounted PageInfo to the base search data
mkSearchData :: FilePath -> PageInfo -> Site Y.Value
mkSearchData mount pi = do
+ link <- rootUrl mount
text <- io . runIOorExplode $ writePlain plainWriteOpts (pi ^. pageDoc)
let title = pi ^? pageMeta . key "title" . _String
- link <- rootUrl mount
+ let tags =
+ pi ^.. pageMeta . key "tags" . values . _String .
+ to (Y.array . map fromString . splitDirectories . T.unpack)
pure $
Y.object
[ ("link", fromString link)
, ("title", maybe (fromString mount) Y.String title)
+ , ("tags", Y.array tags)
, ("text", Y.String text)
]