hugo_frigg/layouts/archives/single.html

64 lines
2.1 KiB
HTML

{{ partial "header.html" . }}
<body>
<main class="wrapper">
{{ partial "navigation.html" . }}
<section class="container archive">
<article>
<header class="post-header">
<h1 class="post-title">
{{ .Title }}
</h1>
{{ $img := newScratch }}
{{ $folder := (print "/content/" .File.Dir "gallery/") }}
{{ $files := readDir $folder }}
{{ range sort $files "Name" "asc" }}
{{ if not .IsDir }}
{{ $img.Add "list" (slice .Name) }}
{{ end }}
{{ end }}
{{ with ($img.Get "list") }}
{{ $img.Set "max" (add 1 (int (index (split (index (split (index (last 1 .) 0) ".") 0) "img") 1))) }}
{{ end }}
{{ range $index, $val := $img.Get "list" }}
{{ $curr := index (split $val ".") 0 }}
{{ $prec := mod (add (sub $index 1) ($img.Get "max")) ($img.Get "max") }}
{{ $next := mod (add $index 1) ($img.Get "max") }}
<a class="thumb hidden_link" href="#img{{ $index }}">
<img src="gallery/thumb/{{ $curr }}.jpg">
</a>
<!-- lightbox container hidden with CSS -->
<div class="lightbox" id="{{ $curr }}">
<a href="#img{{ $prec }}" class="light-btn hidden_link btn-prev"><<</a>
<a href="#_" class="btn-close hidden_link">X</a>
<img src="gallery/{{ $val }}">
<a href="#img{{ $next }}" class="light-btn hidden_link btn-next">>></a>
</div>
{{ end }}
<div class="post-meta">
<!--div class="date">
<span class="posted-on">
<img class="page-icon header-icon" src="/svg/calendar.svg"/>
<time datetime='{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}'>
Article publié le {{ .Date.Day }} {{ index $.Site.Data.snotra.mois (printf "%d" .Date.Month) }} {{ .Date.Year }}
</time>
</span>
<span class="reading-time">
<img class="page-icon header-icon" src="/svg/clock.svg"/>
{{ i18n "reading_time" .ReadingTime }}
</span>
</div-->
{{ partial "categories.html" .Page.Params.Categories }}
{{ partial "tags.html" .Page.Params.Tags }}
</div>
</header>
<div class="archive-body">
{{ .Content }}
</div>
{{ partial "article-footer.html" . }}
</article>
</section>
{{ partial "footer.html" . }}
</main>
</body>
</html>