sort tags, fix md

This commit is contained in:
Mirek Kratochvil 2023-06-18 00:14:35 +02:00
parent 4390d14adf
commit db5847e1ec
2 changed files with 5 additions and 4 deletions

View file

@ -70,6 +70,7 @@ should **not** be deposited in the "personal" namespace, such as at
as this restricts the availability of your code for others. as this restricts the availability of your code for others.
To make sure the project is in the right group, To make sure the project is in the right group,
- when creating a [new - when creating a [new
project](https://gitlab.lcsb.uni.lu/projects/new#blank_project), find the project](https://gitlab.lcsb.uni.lu/projects/new#blank_project), find the
matching group in a dropdown below **Project URL**, in the field marked with matching group in a dropdown below **Project URL**, in the field marked with
@ -81,6 +82,7 @@ To make sure the project is in the right group,
target group in the box labeled with **Select a new namespace**. target group in the box labeled with **Select a new namespace**.
For all projects, make sure that the project visibility matches the expectations: For all projects, make sure that the project visibility matches the expectations:
- **Closed-source projects** should display a small padlock 🔒 next to the - **Closed-source projects** should display a small padlock 🔒 next to the
project title on the main project page, meaning the access is restricted project title on the main project page, meaning the access is restricted
- **Open-source project** should display a small globe icon 🌐, meaning the - **Open-source project** should display a small globe icon 🌐, meaning the

View file

@ -351,14 +351,13 @@ mkSearchData mount pi = do
link <- rootUrl mount link <- rootUrl mount
text <- io . runIOorExplode $ writePlain plainWriteOpts (pi ^. pageDoc) text <- io . runIOorExplode $ writePlain plainWriteOpts (pi ^. pageDoc)
let title = pi ^? pageMeta . key "title" . _String let title = pi ^? pageMeta . key "title" . _String
let tags = -- TODO: unify retrieval of tags
pi ^.. pageMeta . key "tags" . values . _String . let tags = sort $ pi ^.. pageMeta . key "tags" . values . _String . to T.unpack
to (Y.array . map fromString . splitDirectories . T.unpack)
pure $ pure $
Y.object Y.object
[ ("link", fromString link) [ ("link", fromString link)
, ("title", maybe (fromString mount) Y.String title) , ("title", maybe (fromString mount) Y.String title)
, ("tags", Y.array tags) , ("tags", Y.array $ map (Y.array . map fromString . splitDirectories) tags)
, ("text", Y.String text) , ("text", Y.String text)
] ]