Initial commit
This commit is contained in:
45
themes/default/layouts/partials/header.html
Normal file
45
themes/default/layouts/partials/header.html
Normal file
@@ -0,0 +1,45 @@
|
||||
<header>
|
||||
{{ $logo := resources.GetMatch "logo-large.png" }}
|
||||
{{ with $logo.Resize "x120" }}
|
||||
<img src="{{ .RelPermalink }}" alt="Logo" class="site-logo" />
|
||||
{{ end }}
|
||||
<div class="header-content">
|
||||
<h1 class="page-title">{{ .Title }}</h1>
|
||||
<div class="page-meta">
|
||||
{{ with .Date }}
|
||||
<time datetime="{{ . }}">{{ . | time.Format ":date_long" }}</time>
|
||||
{{ end }}
|
||||
{{ $section := "" -}}
|
||||
{{- with .Parent -}}
|
||||
{{- $sectionPath := path.Base .File.Dir -}}
|
||||
{{- $section = $sectionPath -}}
|
||||
{{- end -}}
|
||||
<span class="section section-{{ $section }}">{{ .Parent.LinkTitle }}</span>
|
||||
{{- if ge .ReadingTime 5 -}}
|
||||
{{- .ReadingTime }} min de lecture
|
||||
{{- end -}}
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<div class="tablet-header">
|
||||
{{ $logo := resources.GetMatch "logo-large.png" }}
|
||||
{{ with $logo.Resize "x32" }}
|
||||
<img src="{{ .RelPermalink }}" alt="Logo réduit" class="tablet-logo" />
|
||||
{{ end }}
|
||||
<span class="tablet-title">{{ .Title }}</span>
|
||||
<div class="tablet-links">
|
||||
<a href="/" title="Retour à la page d'accueil du site">⌂</a>
|
||||
{{ if and (.Parent) (ne .Parent.RelPermalink "/") }}
|
||||
<a href="{{ .Parent.RelPermalink }}" title="Retour à la section parente">↰</a>
|
||||
{{ end }}
|
||||
|
||||
{{ with .TableOfContents }}
|
||||
{{ if gt (len (plainify .)) 0 }}
|
||||
<details id="toc" title="Table des matières">
|
||||
<summary>☰</summary>
|
||||
{{ . | safeHTML }}
|
||||
</details>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user