feat: navigation arrows + breadcrumb

This commit is contained in:
Mathieu Cornic 2016-03-17 14:10:43 +01:00
parent 9c977de1a2
commit 0495785eda
3 changed files with 25 additions and 4 deletions

View file

@ -4,9 +4,12 @@
{{ end }}
</div>
</div>
<div id="navigation">
<a class="nav nav-next" href="/basics/what-is-grav" style="margin-right: 0px;"><i class="fa fa-chevron-right"></i></a>
{{ with .Params.prev }}<a class="nav nav-prev" href="{{ . }}"> <i class="fa fa-chevron-left"></i></a>{{ end }}
{{ with .Params.next }}<a class="nav nav-next" href="{{ . }}" style="margin-right: 0px;"><i class="fa fa-chevron-right"></i></a>{{ end }}
</div>
</section>
<div style="left: -1000px; overflow: scroll; position: absolute; top: -1000px; border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;">
<div style="border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;"></div>

View file

@ -34,15 +34,33 @@
<i class="fa fa-2x fa-bars"></i>
</a>
<div id="top-bar">
{{ if and .IsPage .Site.Params.editURL }}
{{ $File := .File }}
{{ $Site := .Site }}
{{with $File.Path }}
<div id="top-github-link">
<a class="github-link" href="https://github.com/getgrav/grav-learn/blob/develop/pages/01.basics/chapter.md">
<a class="github-link" href="{{ $Site.Params.editURL }}{{ $File.Dir }}{{ $File.LogicalName }}" target="blank">
<i class="fa fa-github-square"></i>
edit this page
</a>
</div>
{{ end }}
{{ end }}
<div id="breadcrumbs" itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb">
<span itemprop="title">Basics</span>
{{ $type := .Type }}
{{ $relLink := .RelPermalink }}
{{ range $name , $value := .Site.Sections }}
{{ if eq $name $type }}
{{ $first := (index $value 0).Page }}
{{ if ne $first.RelPermalink $relLink }}
<a href="{{ $first.RelPermalink }}" itemprop="url"><span itemprop="title">{{ $first.Title }}</span></a> <i class="fa fa-angle-right"></i>
{{ end }}
{{ end }}
{{ end }}
{{ with .Title }}<span itemprop="title"> {{ . }}</span>{{ end }}
</div>
</div>
{{ if .Params.chapter }}
<div id="chapter">

View file

@ -45,7 +45,7 @@ body {
a {
color: #CE3B2F; }
a:hover {
color: #0082a7; }
color: #F77D73; }
pre {
position: relative; }