xxxxxxxxxx
view : Maybe String -> Browser.Document msg
view maybeArticlePath =
articleNotFoundDocument
articleNotFoundDocument : Browser.Document msg
articleNotFoundDocument =
{ title = "Article Not Found"
, body = [ text "Article not found..." ]
}
xxxxxxxxxx
view : Maybe String -> Browser.Document msg
view maybeArticlePath =
Dict.get articlePath Dict.empty
|> Maybe.map articleDocument
|> Maybe.withDefault articleNotFoundDocument
xxxxxxxxxx
view : Maybe String -> Browser.Document msg
view maybeArticlePath =
Dict.get articlePath articles
|> Maybe.map articleDocument
|> Maybe.withDefault articleNotFoundDocument
articles =
Dict.empty
xxxxxxxxxx
view : Maybe String -> Browser.Document msg
view maybeArticlePath =
Dict.get articlePath articles
|> Maybe.map articleDocument
|> Maybe.withDefault articleNotFoundDocument
articles : Dict String Article
articles =
Dict.empty
xxxxxxxxxx
articles : Dict String Article
articles =
Dict.fromList []
xxxxxxxxxx
Dict.fromList
[ ( "hello"
, { title = "Hello!",
body = "Here's a nice article for you! 🎉"
}
)
]