Move diffent nav files into one

This commit is contained in:
Hanzei 2018-06-12 01:39:40 +02:00
parent d39cbfe868
commit 1086eeebf4
No known key found for this signature in database
GPG key ID: 69A2DEFD98937BA0
11 changed files with 79 additions and 129 deletions

View file

@ -9,14 +9,12 @@
<!-- Everything below fades in two! -->
<div class="section {{ if .Site.Params.fadeIn }} fade-in two {{ end }}">
<div class="container"><!-- Begin Nav bar -->
{{ partial "nav-single.html" . }}
</div><!-- End Nav bar -->
<div class="container {{ if .Site.Params.fadeIn }} fade-in two {{ end }} top-pad"><!-- Begin blurb -->
{{ partial "nav.html" . }}
<!-- Begin blurb -->
<div class="container {{ if .Site.Params.fadeIn }} fade-in two {{ end }} top-pad">
Oops! Either you've found a bug (in which case, <a href="mailto:{{ .Site.Params.email }}">please tell me</a>) or you're just making things up. This page doesn't exist!
</div><!-- End blurb -->
</div>
<!-- End blurb -->
<div class="container top-pad"><hr></div>
{{ partial "footer.html" . }}

View file

@ -12,11 +12,8 @@
<!-- Everything below fades in two! -->
<div class="section no-padding {{ if .Site.Params.fadeIn }} fade-in two {{ end }}">
<div class="container">
<!-- Begin Nav bar -->
{{ partial "nav-list.html" . }}
</div>
<!-- End Nav bar -->
{{ partial "nav.html" . }}
<article>
<!-- "{{.Content}}" pulls from the markdown content of the corresponding _index.md -->
{{ .Content }}

View file

@ -12,11 +12,8 @@
<!-- Everything below fades in two! -->
<div class="section {{ if .Site.Params.fadeIn }} fade-in two {{ end }}">
<div class="container">
<!-- Begin Nav bar -->
{{ partial "nav-single.html" . }}
</div>
<!-- End Nav bar -->
{{ partial "nav.html" . }}
<div class="container markdown {{ if .Site.Params.fadeIn }} fade-in two {{ end }} top-pad">
<!-- Begin blog post content -->

View file

@ -12,11 +12,8 @@
<!-- Everything below fades in two! -->
<div class="section no-padding {{ if .Site.Params.fadeIn }} fade-in two {{ end }}">
<div class="container">
<!-- Begin Nav bar -->
{{ partial "nav-list.html" . }}
</div>
<!-- End Nav bar -->
{{ partial "nav.html" . }}
<article>
<!-- "{{.Content}}" pulls from the markdown content of the corresponding _index.md -->
{{ .Content }}

View file

@ -13,11 +13,8 @@
<!-- Everything below fades in two! -->
<div class="section no-padding {{ if .Site.Params.fadeIn }} fade-in two {{ end }}">
<div class="container">
<!-- Begin Nav bar -->
{{ partial "nav-list.html" . }}
</div>
<!-- End Nav bar -->
{{ partial "nav.html" . }}
<article>
<!-- "{{.Content}}" pulls from the markdown content of the corresponding _index.md -->
{{ .Content }}

View file

@ -10,9 +10,7 @@
<!-- Everything below fades in two! -->
<div class="section no-padding {{ if .Site.Params.fadeIn | default true }}fade-in two{{ end }}">
<div class="container"><!-- Begin Nav bar -->
{{ partial "nav-list.html" . }}
</div><!-- End Nav bar -->
{{ partial "nav.html" . }}
<div class="container"><!-- Begin Blog container -->

View file

@ -7,12 +7,10 @@
<h1 class="bold-title is-1">{{ .Site.Params.blogHead | default "Blog" }}</h1>
</div><!-- End Title -->
<!-- Everything below fades in two! -->
<div class="section {{ if .Site.Params.fadeIn | default true }}fade-in two{{ end }}">
<!-- Everything below fades in two! -->
<div class="section {{ if .Site.Params.fadeIn | default true }}fade-in two{{ end }}">
<div class="container"><!-- Begin Nav bar -->
{{ partial "nav-single.html" . }}
</div><!-- End Nav bar -->
{{ partial "nav.html" . }}
<div class="container {{ if .Site.Params.fadeIn | default true }}fade-in two{{ end }}"><!-- Begin blog title container -->
<h2 class="title is-1 top-pad strong-post-title"><a href="{{ .Permalink }}">{{ .Title }}</a></h2>

View file

@ -22,23 +22,14 @@
</div>
<!-- End top social icons -->
</div>
</div> <!-- Hero body title end -->
<!-- Hero foot has nav bar -->
</div>
<!-- Hero body title end -->
<div class="hero-foot {{ if .Site.Params.fadeIn | default true }}fade-in three{{ end }}">
<hr>
<nav class="nav-center">
<a class="nav-item" href="#about">About</a>
{{ if .Site.Params.showProjects }}
<a class="nav-item" href="#projects">Projects</a>
{{ end }}
{{ if .Site.Params.showBlog }}
<a class="nav-item" href="#blog">Blog</a>
{{ end }}
<a class="nav-item" href="#contact">Contact</a>
</nav>
<hr>
</div><!-- Done with nav bar -->
</div><!-- Done with Hero -->
{{ partial "nav.html" . }}
</div>
</div>
<!-- Done with Hero -->
<!-- Everything below fades in three! -->
<div class="section no-padding {{ if .Site.Params.fadeIn | default true }}fade-in three{{ end }}">

View file

@ -1,35 +0,0 @@
<hr>
<nav class="nav nav-center">
<span id="nav-toggle" class="nav-toggle" onclick="document.getElementById('nav-menu').classList.toggle('is-active');">
<span></span>
<span></span>
<span></span>
</span>
<div id="nav-menu" class="nav-left nav-menu">
<span class="nav-item">
<a href="{{ "/" | relURL }}">Main</a>
</span>
<span class="nav-item">
<a href="{{ "/about" | relURL }}">About</a>
</span>
{{ if and (.Site.Params.showProjects) (ne .Page.Section "projects") }}
<span class="nav-item">
<a href="{{ "/projects" | relURL }}">Projects</a>
</span>
{{ end }}
{{ if and (.Site.Params.showBlog) (ne .Page.Section "blog") }}
<span class="nav-item">
<a href="{{ "/blog" | relURL }}">Blog</a>
</span>
{{ end }}
<span class="nav-item">
<a href="{{ "/contact" | relURL }}">Contact</a>
</span>
{{ if .Site.RSSLink }}
<span class="nav-item">
<a href="{{ .Site.RSSLink }}"><i class="fa fa-rss"></i></a>
</span>
{{ end }}
</div>
</nav>
<hr>

View file

@ -1,43 +0,0 @@
<hr>
<nav class="nav nav-center">
<span id="nav-toggle" class="nav-toggle" onclick="document.getElementById('nav-menu').classList.toggle('is-active');">
<span></span>
<span></span>
<span></span>
</span>
<div id="nav-menu" class="nav-left nav-menu">
<span class="nav-item">
<a href="{{ "/" | relURL }}">Main</a>
</span>
<span class="nav-item">
<a href="{{ "/about" | relURL }}">About</a>
</span>
{{ if .Site.Params.showProjects }}
<span class="nav-item">
{{ if ne .Section "projects" }}
<a href="{{ "/projects" | relURL }}">Projects</a>
{{ else }}
<a href="{{ "/projects" | relURL }}">Back to Projects</a>
{{ end }}
</span>
{{ end }}
{{ if .Site.Params.showBlog }}
<span class="nav-item">
{{ if ne .Section "blog" }}
<a href="{{ "/blog" | relURL }}">Blog</a>
{{ else }}
<a href="{{ "/blog" | relURL }}">Back to Blog</a>
{{ end }}
</span>
{{ end }}
<span class="nav-item">
<a href="{{ "/contact" | relURL }}">Contact</a>
</span>
{{ if .Site.RSSLink }}
<span class="nav-item">
<a href="{{ .Site.RSSLink }}"><i class="fa fa-rss"></i></a>
</span>
{{ end }}
</div>
</nav>
<hr>

55
layouts/partials/nav.html Normal file
View file

@ -0,0 +1,55 @@
<!-- Begin Nav bar -->
<div class="container">
<hr>
<nav class="nav nav-center">
{{ if not .Page.IsHome }}
<span id="nav-toggle" class="nav-toggle" onclick="document.getElementById('nav-menu').classList.toggle('is-active');">
<span></span>
<span></span>
<span></span>
</span>
<div id="nav-menu" class="nav-left nav-menu">
{{ end }}
{{ if not .Page.IsHome }}
<a class="nav-item" href="{{ "/" | relURL }}">Main</a>
{{ end }}
<a class="nav-item" href="{{ "/#about" | relURL }}">About</a>
{{ if and (.Site.Params.showProjects) (not (and (eq .Page.Section "projects") (eq .Page.Kind "section") )) }}
{{ if .IsHome }}
<a class="nav-item" href="{{ "/#projects" | relURL }}">Projects</a>
{{ else}}
{{ if ne .Section "projects" }}
<a class="nav-item" href="{{ "/projects" | relURL }}">Projects</a>
{{ else }}
<a class="nav-item" href="{{ "/projects" | relURL }}">Back to Projects</a>
{{ end }}
{{ end }}
{{ end }}
{{ if and (.Site.Params.showBlog) (not (and (eq .Page.Section "blog") (eq .Page.Kind "section") )) }}
{{ if .IsHome }}
<a class="nav-item" href="{{ "/#blog" | relURL }}">Blog</a>
{{ else }}
{{ if ne .Section "blog" }}
<a class="nav-item" href="{{ "/blog" | relURL }}">Blog</a>
{{ else }}
<a class="nav-item" href="{{ "/blog" | relURL }}">Back to Blog</a>
{{ end }}
{{ end}}
{{ end }}
<a class="nav-item" href="{{ "/#contact" | relURL }}">Contact</a>
{{ if and .Site.Params.showRSSButton .Site.RSSLink }}
<a class="nav-item" href="{{ .Site.RSSLink }}"><i class="fa fa-rss"></i></a>
{{ end }}
{{ if not .Page.IsHome }}
</div>
{{ end }}
</nav>
<hr>
</div>
<!-- End Nav bar -->