Framework pour créer son site web en 2 minutes, et en Markdown! https://www.gregandev.fr
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
2.8 KiB

9 months ago
{{ define "head" }}
<!-- {{ if .IsHome }} -->
<style type="text/css">
.feature-image {
background-image: linear-gradient(
rgba(0, 0, 0, 0.15),
rgba(0, 0, 0, 0.15)
), url('{{ "images/unix.jpg" | absURL }}');
height: 500px;
}
.feature-image-text {
margin-top: 20px;
}
@media (min-width: 1200px) {
.feature-image {
background-position: 0% 30%;
}
}
@media (max-width: 768px) {
.feature-image {
height: 250px;
background-position: 0% 0%;
}
}
</style>
<!-- {{ else }} -->
<!-- {{ end }} -->
{{ end }}
{{ define "header" }}
{{ if .IsHome }}
<header class="feature-image">
<div class="feature-image-text white-shadow-text">
{{ partial "header-about-me" . }}
</div>
</header>
{{ end }}
{{ if not .IsHome }}
<header class="feature-image">
<div class="feature-image-text">
<h1 class="text-center">{{ .Title }}</h1>
{{ if eq .Type "categories" }}
{{ $title := urlize .Title }}
{{ with .Site.Taxonomies.categories }}
{{ range $name, $taxonomy := . }}
{{ $term := urlize $name }}
{{ if eq $term $title }}
A {{ $taxonomy.Count }}-post collection
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ if eq .Type "tags" }}
{{ $title := urlize .Title }}
{{ with .Site.Taxonomies.tags }}
{{ range $name, $taxonomy := . }}
{{ $term := urlize $name }}
{{ if eq $term $title }}
A {{ $taxonomy.Count }}-post collection
{{ end }}
{{ end }}
{{ end }}
{{ end }}
</div>
</header>
{{ end }}
{{ end }}
{{ define "main" }}
<div class="container mt-4 mb-4 recent-posts" style="text-align: center;">
<!-- {{ $pages := .Pages }} -->
<!-- {{ if .IsHome }}
{{ $pages = where site.RegularPages "Type" "in" site.Params.mainSections }}
{{ end }} -->
<!-- {{ $paginator := .Paginate (where $pages "Params.hidden" "ne" true) 10 }} -->
<!-- {{ range $paginator.Pages }} -->
<article class="post">
<a class="title" href="{{ .Permalink }}"><h2>{{ .Title }}</h2></a>
<!-- {{ partial "post-meta" . }} -->
<div>
<!-- {{ .Summary }} -->
</div>
<!-- <div>
<a href="{{ .Permalink }}" class="btn btn-outline-secondary" role="button">Continuer</a>
</div> -->
</article>
<!-- {{ end }} -->
<div class="d-flex justify-content-center">
{{ template "_internal/pagination.html" . }}
</div>
</div>
{{ end }}