updates on #18

This commit is contained in:
Henrique Dias 2016-08-26 21:59:06 +01:00
parent c29d066842
commit aa7d4f69ef
3 changed files with 68 additions and 11 deletions

View File

@ -1,3 +1,4 @@
a
/* NORMALIZE CSS */
html {
@ -673,6 +674,50 @@ header .only-side {
display: none;
}
header #prev:hover + .prev-links,
header .prev-links:hover {
display: flex;
}
#prev {
border-radius: 0;
}
header .prev-links {
position: absolute;
color: #7d7d7d;
list-style: none;
margin: 0;
padding: 0;
background: #fff;
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
border-radius: .2em;
flex-direction: column-reverse;
left: 1.5em;
display: none;
}
header .prev-links a {
padding: .5em;
border-bottom: 1px solid #f5f5f5;
transition: .2s ease all;
}
header .prev-links a:first-child {
border: 0;
border-bottom-right-radius: .5em;
border-bottom-left-radius: .5em;
}
header .prev-links a:last-child {
border-top-right-radius: .5em;
border-top-left-radius: .5em;
}
header .prev-links a:hover {
background-color: #f5f5f5;
}
.action {
display: inline-block;
margin: 0 0.2em;
@ -1117,4 +1162,4 @@ i.spin {
column-count: 1;
column-gap: 0;
}
}
}

View File

@ -17,26 +17,33 @@
<header>
<div>
{{ $lnk := .PreviousLink }}
{{ if ne $lnk ""}}
<a href="{{ $lnk }}">
{{ end }}
<div class="action{{ if eq $lnk ""}} disabled{{ end }}" id="prev">
{{ if ne $lnk ""}}
<a href="{{ $lnk }}">
{{ end }}
<i class="material-icons" title="Previous">subdirectory_arrow_left</i>
</div>
{{ if ne $lnk ""}}
</a>
{{ end }}
</div>
{{ if ne $lnk ""}}
</a>
{{ end }}
<ul class="prev-links">
{{ range $link, $name := .BreadcrumbMap }}
<a href="{{ $link }}"><li>{{ $name }}</li></a>
{{ end }}
</ul>
{{ end }}
<div class="action" id="open-nav">
<i class="material-icons" title="Menu">menu</i>
</div>
<p>
<a href="{{ if eq .Config.AbsoluteURL "" }}/{{ else }}{{ .Config.AbsoluteURL }}{{ end }}">
{{ if .Config.HugoEnabled }}Hugo{{ else }}File Manager{{ end }}
</a>
{{ if ne .Name "/"}}
<i class="material-icons">chevron_right</i>{{ .Name }}
{{ .Name }}
</p>
{{ end }}
</div>
@ -50,6 +57,7 @@
<div class="action{{ if eq $lnk ""}} disabled{{ end }}" id="prev">
<i class="material-icons" title="Previous">subdirectory_arrow_left</i>
</div>
{{ if ne $lnk ""}}
</a>
{{ end }}

View File

@ -46,6 +46,10 @@ func (i Info) BreadcrumbMap() map[string]string {
parts := strings.Split(lpath, "/")
for i, part := range parts {
if i == len(parts)-1 {
continue
}
if i == 0 && part == "" {
// Leading slash (root)
result["/"] = "/"