diff options
| author | Mirek Kratochvil <exa.exa@gmail.com> | 2023-06-17 20:55:26 +0200 |
|---|---|---|
| committer | Mirek Kratochvil <exa.exa@gmail.com> | 2023-06-17 20:55:26 +0200 |
| commit | 33cb84713fc6cbbd7925c9d51c61e94d3e3cff77 (patch) | |
| tree | bae265e41af428db4db10f1583061b996cbba21b /site.hs | |
| parent | 32a49d3179a969604410ff7507af939c77045b4f (diff) | |
| download | reploy-33cb84713fc6cbbd7925c9d51c61e94d3e3cff77.tar.gz reploy-33cb84713fc6cbbd7925c9d51c61e94d3e3cff77.tar.bz2 | |
add tags to the search metadata
Diffstat (limited to 'site.hs')
| -rw-r--r-- | site.hs | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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) ] |
