From 007eee127e9d416ba0460c1c87bd520879e1c93b Mon Sep 17 00:00:00 2001 From: Rok Garbas Date: Thu, 11 Jun 2020 09:14:21 +0200 Subject: [PATCH] Make sure that we dont trap users on search.nixos.org (#87) and that there is a nice way back to main website also the navigation is now the same hight as on nixos.org fixes #59 --- src/Main.elm | 22 ++++++++++++---------- src/index.scss | 16 +++++++++------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/src/Main.elm b/src/Main.elm index 685908f..91ea597 100644 --- a/src/Main.elm +++ b/src/Main.elm @@ -238,10 +238,13 @@ view model = [ div [ class "navbar navbar-static-top" ] [ div [ class "navbar-inner" ] [ div [ class "container" ] - [ a [ class "brand", href "https://search.nixos.org" ] + [ a [ class "brand", href "https://nixos.org" ] [ img [ src "https://nixos.org/logo/nix-wiki.png", class "logo" ] [] ] - , viewNavigation model.page model.url + , div [ class "nav-collapse collapse" ] + [ ul [ class "nav pull-left" ] + (viewNavigation model.page model.url) + ] ] ] ] @@ -263,7 +266,7 @@ view model = ] -viewNavigation : Page -> Url.Url -> Html Msg +viewNavigation : Page -> Url.Url -> List (Html Msg) viewNavigation page url = let preserveSearchOptions = @@ -288,13 +291,12 @@ viewNavigation page url = |> List.append preserveSearchOptions |> Url.Builder.absolute [ path ] in - ul [ class "nav" ] - (List.map - (viewNavigationItem url) - [ ( createUrl "packages", "Packages" ) - , ( createUrl "options", "Options" ) - ] - ) + List.map + (viewNavigationItem url) + [ ( "https://nixos.org", "Back to nixos.org" ) + , ( createUrl "packages", "Packages" ) + , ( createUrl "options", "Options" ) + ] viewNavigationItem : diff --git a/src/index.scss b/src/index.scss index b0e43f8..7ccbabf 100644 --- a/src/index.scss +++ b/src/index.scss @@ -14,16 +14,18 @@ footer { height: 4rem; } -header .navbar { - a.brand { - line-height: 1.5em; +header .navbar.navbar-static-top { + .brand { + padding-bottom: 0; } img.logo { - height: 1.5em; - margin-right: 0.5em; + margin-top: -5px; + padding-right: 5px; + line-height: 25px; + height: 25px; } - ul.nav > li > a { - line-height: 2.5em; + ul.nav > li { + line-height: 20px; } }