First version of the theme

This commit is contained in:
Gregory Trolliet 2021-10-26 11:34:30 +02:00
commit 8dd30f6eb8
61 changed files with 1658 additions and 0 deletions

5
layouts/archives/li.html Normal file
View file

@ -0,0 +1,5 @@
<a class="archive hidden_link" href="{{ .Params.ExternalLink | default .RelPermalink }}">
<img class="thumbnail" src="{{ .RelPermalink }}/thumb.jpg" />
<span class="description">{{ .Title }}</span>
<span class="more">&rarr; plus d'infos</span>
</a>

View file

@ -0,0 +1,24 @@
{{ partial "header.html" . }}
<body>
<main class="wrapper">
{{ partial "navigation.html" . }}
<section id="blog-list" class="container liste">
<article>
<header>
<h1 class="list-title">
{{ i18n "articles" | title }}
</h1>
</header>
<div class="archives-list">
{{- range .Paginator.Pages -}}
{{- .Render "li" -}}
{{- end -}}
</div>
</article>
{{ partial "pagination.html" . }}
</section>
{{ partial "footer.html" . }}
</main>
</body>
</html>

View file

@ -0,0 +1,63 @@
{{ 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>