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,52 @@
{{ define "main" }}
<header>
<div class="container">
<h1>{{ .Title }}</h1>
<p class="subtitle">{{ .Params.subtitle }}</p>
</div>
</header>
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
<section>
<div class="container">
<div class="filter-container">
{{ $maxCategoryToShow := $.Site.Params.maxCategoryToShow | default 5 }}
{{ range .Site.Taxonomies.categories.TaxonomyArray | first $maxCategoryToShow }}
<div class="filter-item" data-value="{{ .Page.Title }}" data-type="categories">
{{ .Page.Title }}<sup>{{ .Count }}</sup>
</div>
{{ end }}
</div>
<input id="search-query" type="search" placeholder="Faça sua pesquisa...">
<div id="search-results">
</div>
<section id="articles-list">
{{ range $pages.GroupByDate "2006" }}
<section>
<h2>{{ .Key }}</h2>
<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>
</a>
</div>
{{ end }}
</div>
</section>
{{ end }}
</section>
</div>
</section>
{{- $opts := dict "minify" hugo.IsProduction -}}
{{ $search := resources.Get "ts/search.ts" | js.Build $opts | fingerprint }}
<script async src="{{ $search.RelPermalink }}"></script>
{{ end }}

View file

@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}">
{{ partial "head/head" . }}
{{ partialCached "head/colorScheme" . }}
<body class="dark">
{{ partial "header.html" . }}
<main>
{{ block "main" . }}{{ end }}
</main>
{{ partialCached "footer/footer" . }}
</body>
</html>

View file

@ -0,0 +1,79 @@
{{ define "main" }}
<div class="container">
<section class="my">
<div class="content">
{{ with .Content }}
{{ . }}
{{ end }}
<div class="bio-social">
{{ range $name, $path := $.Param "socialOptions" }}
{{ if (and $path (ne $name "email")) }}
<a href="{{ $path | safeURL }}" target="_blank" rel="noreferrer" title="{{ $name }}"
aria-label="{{ $name }}">
{{ partial (print "svgs/social/" $name ".svg") (dict "width" 25 "height" 25) }}
</a>
{{ end }}
{{ if (and $path (eq $name "email")) }}
<a href="mailto:{{ $path | safeURL }}" target="_blank" rel="noreferrer" title="{{ $path }}"
aria-label="{{ $name }}">
{{ partial (print "svgs/social/" $name ".svg") (dict "width" 25 "height" 25) }}
</a>
{{ end }}
{{ end }}
</div>
</div>
</section>
</div>
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
{{ $projects := where .Site.RegularPages "Section" "projects" }}
{{ $pages = .Paginate ($pages) }}
{{ $archivesPage := first 1 (where .Site.RegularPages "Layout" "eq" "archives") }}
<div class="container">
<section>
<h2>
Últimas Postagens
{{ range $archivesPage }}
<a class="section-button" href="{{ .RelPermalink }}">Ver todas</a>
{{ end }}
</h2>
<div class="posts">
{{ range $pages.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>
{{ if gt (len $projects) 0}}
<section>
<h2>Projetos</h2>
<div class="projects">
{{ range $projects.ByWeight }}
<div class="project">
<div>
<a href="{{ .Params.link }}" target="_blank" rel="noreferrer">
<div class="icon">{{ .Params.icon }}</div>
<h3>{{ .Title }}</h3>
</a>
<div class="description">{{ .Params.description }}</div>
</div>
<div class="flex">
<a href="{{ .Params.repo }}" class="button" target="_blank" rel="noreferrer">Source</a>
</div>
</div>
{{ end }}
</div>
</section>
{{ end }}
</div>
{{ end }}

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 }}

View file

@ -0,0 +1,59 @@
{{ define "main" }}
<div class="container">
<article>
<header class="article-header">
<div class="thumb">
<div>
<h1>{{ .Title }}</h1>
<div class="post-meta">
<div>
{{ $author := .Params.author }}
{{ if eq $author nil }}
{{ $author = .Site.Params.author }}
{{ end }}
Por {{ $author }} | <time>{{ .Date.Format "January 02, 2006" }}</time>
| {{ .ReadingTime }} minutos
</div>
<div class="tags">
{{ range (.GetTerms "tags") }}
<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
{{ end }}
</div>
</div>
</div>
</div>
</header>
</article>
<div class="article-post">
{{ .Content }}
</div>
</div>
<div class="container">
{{ if .Section }}
<nav class="flex container suggested">
{{ with .PrevInSection }}
<a rel="prev" href="{{ .RelPermalink }}" title="Postagem Anterior">
<span>Anterior</span>
{{ .Title }}
</a>
{{ end }}
{{ with .NextInSection }}
<a rel="next" href="{{ .RelPermalink }}" title="Próxima Postagem">
<span>Próxima</span>
{{ .Title }}
</a>
{{ end }}
</nav>
{{ end }}
</div>
{{ if or (not (isset .Params "comments")) (eq .Params.comments "true")}}
<div class="container">
{{ partial "comments/include" . }}
</div>
{{ end }}
</main>
{{ end }}

View file

@ -0,0 +1,22 @@
{{ define "main" }}
{{ $pages := .Pages }}
{{ $pages = (.Paginate $pages).Pages }}
<header>
<div class="container">
<h1>{{ .Title }}</h1>
</div>
</header>
<section>
<div class="container">
<div class="terms">
{{ range (index .Site.Taxonomies (.Title | lower)) }}
<a href="{{ .Page.RelPermalink }}">{{ .Page.Title }} <span class="bg-number">{{ .Count }}</span></a>
{{ end }}
</div>
</div>
</section>
{{ end }}