Fix title of the app before it loads (#97)
and improve window title per page fixes #93
This commit is contained in:
parent
9f3de349e8
commit
2daa4b0d8b
31
src/Main.elm
31
src/Main.elm
|
@ -252,9 +252,28 @@ update msg model =
|
|||
-- VIEW
|
||||
|
||||
|
||||
view : Model -> Html Msg
|
||||
view :
|
||||
Model
|
||||
->
|
||||
{ title : String
|
||||
, body : List (Html Msg)
|
||||
}
|
||||
view model =
|
||||
div []
|
||||
let
|
||||
title =
|
||||
case model.page of
|
||||
Packages _ ->
|
||||
"NixOS Search - Packages"
|
||||
|
||||
Options _ ->
|
||||
"NixOS Search - Options"
|
||||
|
||||
_ ->
|
||||
"NixOS Search"
|
||||
in
|
||||
{ title = title
|
||||
, body =
|
||||
[ div []
|
||||
[ header []
|
||||
[ div [ class "navbar navbar-static-top" ]
|
||||
[ div [ class "navbar-inner" ]
|
||||
|
@ -285,6 +304,8 @@ view model =
|
|||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
viewNavigation : Page -> Url.Url -> List (Html Msg)
|
||||
|
@ -367,9 +388,5 @@ main =
|
|||
, onUrlChange = ChangedUrl
|
||||
, subscriptions = subscriptions
|
||||
, update = update
|
||||
, view =
|
||||
\m ->
|
||||
{ title = "NixOS Search"
|
||||
, body = [ view m ]
|
||||
}
|
||||
, view = view
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Elm hotloading dev environment</title>
|
||||
<title>NixOS Search - Loading...</title>
|
||||
|
||||
|
||||
<script type="text/javascript" src="https://nixos.org/js/jquery.min.js"></script>
|
||||
|
|
Loading…
Reference in a new issue