fix: Replace dots in URLs for Hex doc links

This should fix the broken link to the upgrade guide, which is generated
as https://hexdocs.pm/ash/upgrading-to-3.0.html - should be https://hexdocs.pm/ash/upgrading-to-3-0.html
This commit is contained in:
Rebecca Le 2024-05-23 17:34:26 +08:00
parent b8d1415684
commit 0a35cc2a11
No known key found for this signature in database
GPG key ID: BEED83CCD3479C1D

View file

@ -34,7 +34,7 @@ defmodule AshHqWeb.Helpers do
end
def hex_link(%AshHq.Docs.Guide{route: route}, library, _library_version) do
name = route |> Path.split() |> List.last()
name = route |> Path.split() |> List.last() |> String.replace(".", "-")
"https://hexdocs.pm/#{library.name}/#{name}.html"
end
end