Better breadcrumb

This commit is contained in:
echarp 2022-11-27 21:55:49 +01:00
parent a90abc799d
commit 5264c64901
5 changed files with 21 additions and 25 deletions

View File

@ -1,5 +1,5 @@
---
title: 1ere quiz
title: 1er quiz
ac_create:
- /pages/1er-quiz/start
---

View File

@ -4,21 +4,17 @@
.breadcrumb {
display: none;
}
body.author .breadcrumb {
display: initial;
}
.breadcrumb ol {
padding: 0;
margin-top: 0;
}
.with-breadcrumb .breadcrumb {
display: initial;
}
.breadcrumb li {
display: inline;
}
.breadcrumb li + li:before {
content: ">";
padding-left: 0.3rem;
padding-right: 0.5rem;
}
dl {

View File

@ -12,9 +12,14 @@
{{ end }}
<div class="blah w-100{{ if $featured_image }} w-60-ns{{ end }}">
{{ if .IsPage }}
<div class="breadcrumb">{{- partial "breadcrumb" . -}}</div>
{{ end }}
<header>
<time class="db f6 fr" datetime="{{ .Date }}">
{{ .Date | time.Format .Site.Params.date_format }}
</time>
<ol class="breadcrumb nav navbar-nav">
{{ partial "breadcrumb" .Parent }}
</ol>
</header>
<h1 class="f3 fw1 athelas mt0 lh-title">
<a href="{{.RelPermalink}}" class="color-inherit dim link">

View File

@ -1,5 +1,6 @@
{{ define "main" }}
<section class="pa3 pa4-ns nested-copy-line-height">
<section class="pa3 pa4-ns nested-copy-line-height
{{ if (le (.RelPermalink | strings.Count "/") 3) }}with-breadcrumb{{ end }}">
<aside id="actions" class="w-30-l mt4-l fr tc">
{{ if .Parent.IsHome }}
<button id="create"

View File

@ -1,15 +1,9 @@
<time class="db f6 fr" datetime="{{ .Date }}">
{{ .Date | time.Format .Site.Params.date_format }}
</time>
{{ if and .Parent.IsSection (not .Parent.IsHome) }}
{{ partial "breadcrumb.html" .Parent }}
<li>
<a href="{{ .Permalink }}">{{- .Title -}}</a>
</li>
<ol class="nav navbar-nav">
{{ template "breadcrumbnav" (dict "p1" . "p2" .) }}
</ol>
{{ define "breadcrumbnav" }}
{{ if .p1.Parent }}
{{ template "breadcrumbnav" (dict "p1" .p1.Parent "p2" .p2) }}
{{ end }}
{{ if (and .p1.IsSection (not .p1.Parent.IsHome)) }}
<li><a href="{{ .p1.Permalink }}">{{ .p1.Title }}</a></li>
{{ end }}
{{ end }}