Enumerate sections in the header to do links

This commit is contained in:
Alexis Tacnet
2017-01-04 13:48:27 +01:00
parent 8639f8a8b0
commit 5c5fe525d6
2 changed files with 15 additions and 6 deletions

View File

@@ -10,6 +10,7 @@
{{ end }} {{ end }}
{{ end }} {{ end }}
</div> </div>
{{ if ne (len (where .Data.Pages "Title" "!=" $globalTitle)) 0}}
<div class="page-heading">{{ .Title }}</div> <div class="page-heading">{{ .Title }}</div>
<ul> <ul>
{{ range .Data.Pages.ByPublishDate }} {{ range .Data.Pages.ByPublishDate }}
@@ -18,6 +19,7 @@
{{ end }} {{ end }}
{{ end }} {{ end }}
</ul> </ul>
{{ end }}
</div> </div>
</div> </div>
</section> </section>

View File

@@ -5,10 +5,10 @@
<body lang="{{ .Site.Params.lang }}"> <body lang="{{ .Site.Params.lang }}">
{{ if .IsHome }} {{ if .IsPage }}
<section class="header header-home">
{{ else }}
<section class="header"> <section class="header">
{{ else }}
<section class="header header-home">
{{ end }} {{ end }}
<div class="container"> <div class="container">
<a href="{{ .Site.BaseURL }}"><img class="logo" src="{{ .Site.Params.logofile | absURL }}" /></a> <a href="{{ .Site.BaseURL }}"><img class="logo" src="{{ .Site.Params.logofile | absURL }}" /></a>
@@ -16,9 +16,16 @@
<a href="{{ .Site.BaseURL }}"><div class="name"><h1>{{ .Site.Title }}</h1></div></a> <a href="{{ .Site.BaseURL }}"><div class="name"><h1>{{ .Site.Title }}</h1></div></a>
<nav> <nav>
<ul> <ul>
<a href="{{ .Site.BaseURL }}"><li>Blog</li></a> {{ range .Site.Sections }}
<a href="{{ .Site.BaseURL }}about/"><li>About</li></a> {{ range first 1 .Pages }}
<a href="{{ .Site.BaseURL }}projects/"><li>Projects</li></a> <a href="{{ .Section | urlize }}"><li>{{ .Section }}</li></a>
{{ end }}
{{ end }}
{{ range where .Site.Pages "Section" ""}}
{{ if ne .Title "Home"}}
<a href="{{ .Permalink }}"><li>{{ .Title }}</li></a>
{{ end }}
{{ end }}
</ul> </ul>
</nav> </nav>
</div> </div>