From 099d95fd3f6b854c5ef39cb178eed34cacb3eaaa Mon Sep 17 00:00:00 2001 From: ccamel Date: Mon, 22 Jul 2024 12:26:24 +0200 Subject: [PATCH] :adhesive_bandage: Fix routing to maintain compatibility with old URLs --- src/App/Routing.elm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/App/Routing.elm b/src/App/Routing.elm index a83bbf68..9eb14968 100644 --- a/src/App/Routing.elm +++ b/src/App/Routing.elm @@ -12,7 +12,7 @@ import Page.Physics import Page.SoundWaveToggle import Page.Term import Url exposing (Url) -import Url.Parser exposing (Parser, fragment, map, parse) +import Url.Parser exposing (Parser, fragment, map, oneOf, parse, s) type Route @@ -23,7 +23,10 @@ type Route matchRoute : Parser (Route -> a) a matchRoute = - map parseFragment (fragment identity) + oneOf + [ fragment parseFragment + , map Home (s "index.html") -- maintain compatibility with old urls + ] parseFragment : Maybe String -> Route