-
Notifications
You must be signed in to change notification settings - Fork 359
Closed
Labels
Description
Task
Currently, every search result on the packages search results page (e.g. https://ocaml.org/packages/search?q=sundial) has a "Documentation" link, but not every package has documentation.
Instead, when a package has no documentation, no documentation link should be rendered.
How to solve this issue:
- Look at
handler.ml
for an example how to find out if a package has documentation:ocaml.org/src/ocamlorg_web/lib/handler.ml
Lines 731 to 741 in fae1912
let* latest_documented_version = Ocamlorg_package.latest_documented_version t name in match latest_documented_version with | None -> response_404_page | Some version -> Dream.redirect req ~code:302 (Url.Package.documentation ?hash ~version:(Ocamlorg_package.Version.to_string version) ~page:path (Ocamlorg_package.Name.to_string name)) - modify the
packages_search
function inhandler.ml
and thepackages_search.eml
template to omit the "Documentation" link when there is no documentation.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
✅ Done