* fil d'Ariane Breadcrumb
* ôter les draft
This commit is contained in:
25
layouts/_default/single.html
Normal file
25
layouts/_default/single.html
Normal file
@@ -0,0 +1,25 @@
|
||||
{{ define "main" }}
|
||||
<main>
|
||||
<article>
|
||||
{{ if in site.Params.mainSections .Page.Section }}
|
||||
<h1 class="page-title blog">{{ .Title }}</h1>
|
||||
{{ else }}
|
||||
<h1 class="page-title">{{ .Title }}</h1>
|
||||
{{ end }}
|
||||
|
||||
{{- /* Show post information if it's a post, otherwise just the content */ -}}
|
||||
{{ if in site.Params.mainSections .Page.Section }}
|
||||
<p class="blog-post-info">Posted: <time>{{ .Date.Format "2006-01-02" }}</time>
|
||||
{{ partial "blog-taxonomy-info" . }}</p>
|
||||
|
||||
<div class="blog-post-content">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
{{ template "_internal/disqus.html" . }}
|
||||
{{ else }}
|
||||
{{ .Content }}
|
||||
{{ end }}
|
||||
{{ partial "breadcrumbs.html" . }}
|
||||
</article>
|
||||
</main>
|
||||
{{ end }}
|
||||
19
layouts/partials/breadcrumbs.html
Normal file
19
layouts/partials/breadcrumbs.html
Normal file
@@ -0,0 +1,19 @@
|
||||
{{ $siteUrl := replace .Permalink ( printf "%s" .Site.BaseURL) "" }}
|
||||
{{ $.Scratch.Add "sitePath" .Site.BaseURL }}
|
||||
|
||||
{{ $.Scratch.Add "siteBreadcrumbs" (slice (dict "url" .Site.BaseURL "name" "home" "position" 1 )) }}
|
||||
{{ range $index, $element := split $siteUrl "/" }}
|
||||
{{ $.Scratch.Add "sitePath" $element }}
|
||||
{{ $.Scratch.Add "sitePath" "/" }}
|
||||
{{ if ne $element "" }}
|
||||
{{ $.Scratch.Add "siteBreadcrumbs" (slice (dict "url" ($.Scratch.Get "sitePath") "name" . "position" (add $index 2))) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
<nav class="breadcrumbs">
|
||||
<ul>
|
||||
{{ range $.Scratch.Get "siteBreadcrumbs" }}
|
||||
<li><a href="{{ .url }}">{{ humanize .name }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</nav>
|
||||
Reference in New Issue
Block a user