Add translated pages templates

This commit is contained in:
Renne Rocha 2022-02-02 21:58:57 -03:00
parent b4aafcb88f
commit d66dbf5eca
6 changed files with 284 additions and 0 deletions

View file

@ -0,0 +1,59 @@
{{ define "main" }}
{{ $pages := .Pages }}
{{ $pages = (.Paginate $pages).Pages }}
<header>
<div class="container">
<h1>{{ .Title }}</h1>
<p class="subtitle">
<span class="count">{{ len .Pages }}</span> postagens encontradas.
</p>
</div>
</header>
<section>
<div class="container">
<section>
<section>
<div class="posts">
{{ range $pages }}
<div class="post">
<a href="{{ .RelPermalink }}">
<div class="post-row">
<time>{{ .Date.Format "Jan 02" }}</time>
<h3>{{ .Title }}</h3>
</div>
<!--<div class="new-post">New!</div>-->
</a>
</div>
{{ end }}
</div>
</section>
</section>
</div>
</section>
{{- $scope := .Site }}
{{- $paginator := .Paginate (where $scope.RegularPages ".Params.type" "!=" "page") }}
{{- if gt $paginator.TotalPages 1}}
<section>
<div class="container">
<nav class="pagination">
{{- if $paginator.HasPrev}}
<div class="prev-page">
<a href="{{ $paginator.Prev.URL }}">Próxima Página</a>
</div>
{{ end }}
{{- if $paginator.HasNext}}
<div class="next-page">
<a href="{{ $paginator.Next.URL }}">Página Anterior</a>
</div>
{{ end }}
</nav>
</div>
</section>
{{ end }}
{{ end }}