Permalink
Browse files

Restore home navbar (#90)

* Center the navbar again on the home page

* Favor the project page for listing projects

The project listing has its own page we can link to instead of going
back to the (potentially fading in) home page each time.
  • Loading branch information...
er-vin authored and hanzei committed Oct 29, 2018
1 parent 04f47b3 commit 563cf77fe15a904a93cb4aa5f18709ca64d9574e
Showing with 5 additions and 5 deletions.
  1. +4 −1 assets/sass/_base.sass
  2. +1 −4 layouts/partials/nav.html
@@ -165,6 +165,9 @@ hr
background-color: $background
font-size: 1.5rem
.has-content-centered
justify-content: center
.markdown
p
margin-bottom: 1em
@@ -244,4 +247,4 @@ hr
img
display: block
margin: 2rem auto
max-width: 100%
max-width: 100%
@@ -8,7 +8,7 @@
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
</a>
<div class="navbar-menu" id="navMenu">
<div class="navbar-menu {{ if $isHome }}has-content-centered{{ end }}" id="navMenu">
<!-- look for custom menu and include it -->
{{ if .Site.Menus.main }}
{{ range .Site.Menus.main }}
@@ -52,11 +52,8 @@
{{ if not (and $pageIsInProjects (eq .Page.Kind "section")) }}
{{ with .Site.GetPage "/projects" }}
{{ $totalProjects := (len .Pages) }}
{{ $numberOfProjectsToShow := .Site.Params.home.numberOfProjectsToShow | default $totalProjects }}
{{ if $isHome }}
<a class="navbar-item" href="{{ printf "#%s" (.Title | urlize) }}">{{ .Title }}</a>
{{ else if le $totalProjects $numberOfProjectsToShow }}
<a class="navbar-item" href="{{ printf "/#%s" (.Title | urlize) | relLangURL }}">{{ .Title }}</a>
{{ else }}
<a class="navbar-item" href="{{ .Permalink }}">
{{ if $pageIsInProjects }}

0 comments on commit 563cf77

Please sign in to comment.