Ignore trailing slash.

This commit is contained in:
Dillon Kearns 2019-07-23 09:13:29 -07:00
parent 81cd85997b
commit 57f1b6a006

View File

@ -21,7 +21,7 @@ lookup :
lookup content url =
List.Extra.find
(\( path, markup ) ->
(String.split "/" url.path
(String.split "/" (url.path |> dropTrailingSlash)
|> List.drop 1
)
== path
@ -30,6 +30,14 @@ lookup content url =
|> Maybe.map Tuple.second
dropTrailingSlash path =
if path |> String.endsWith "/" then
String.dropRight 1 path
else
path
type alias Content msg =
{ posts :
List