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.
This commit is contained in:
Kevin Ottens 2018-10-29 18:44:11 +01:00 committed by Hanzei
parent 04f47b3377
commit 563cf77fe1
2 changed files with 5 additions and 5 deletions

View file

@ -165,6 +165,9 @@ hr
background-color: $background
font-size: 1.5rem
.has-content-centered
justify-content: center
.markdown
p
margin-bottom: 1em

View file

@ -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 }}