Added breadcrumbs in the Docs section and display tags list in blog posts

This commit is contained in:
Julien Dessaux 2021-03-23 22:58:01 +01:00
parent f5eb463f91
commit f0d45fe81f
4 changed files with 28 additions and 1 deletions

View file

@ -2,8 +2,12 @@
<h1>{{ .Title }}</h1> <h1>{{ .Title }}</h1>
<p>
{{ if ne .PublishDate.Year 1 }}{{ .PublishDate.Format "2006-01-02" }} - {{ end }}{{ .Description }} {{ if ne .PublishDate.Year 1 }}{{ .PublishDate.Format "2006-01-02" }} - {{ end }}{{ .Description }}
{{ if (isset .Params "tags") }}{{ if ge (len .Params.tags) 1 }}<br/>Tag{{ if ge (len .Params.tags) 2 }}s{{ end }}: {{ range .Params.tags }}<a href="/tags/{{ . }}">{{ . }}</a> {{ end }}{{ end }}{{ end }}
</p>
{{ partial "toc.html" . }} {{ partial "toc.html" . }}
{{ .Content }} {{ .Content }}

View file

@ -1,6 +1,6 @@
{{ define "main" }} {{ define "main" }}
<h1>{{ .Title }}</h1> {{ partial "breadcrumbs.html" . }}
{{ with .Content }} {{ with .Content }}
{{ . }} {{ . }}

10
layouts/docs/single.html Normal file
View file

@ -0,0 +1,10 @@
{{ define "main" }}
{{ partial "breadcrumbs.html" . }}
{{ partial "toc.html" . }}
{{ .Content }}
{{ end }}

View file

@ -0,0 +1,13 @@
<p>
{{ if ne .Parent nil }}
{{ if ne .Parent.Parent nil }}
{{ if ne .Parent.Parent.Parent nil }}
<a href="{{ .Parent.Parent.Parent.Permalink }}">{{ .Parent.Parent.Parent.Title }}</a> &gt;
{{ end }}
<a href="{{ .Parent.Parent.Permalink }}">{{ .Parent.Parent.Title }}</a> &gt;
{{ end }}
<a href="{{ .Parent.Permalink }}">{{ .Parent.Title }}</a> &gt;
{{ end }}
<strong>{{ .Title }}</strong><br/>
{{ .Description }}
</p>