Tag and Categorias templates

This commit is contained in:
Alexandre Vicenzi 2020-05-25 21:47:43 +02:00
parent 43ddf545bf
commit 83b9fd18ee
3 changed files with 47 additions and 1 deletions

View File

@ -0,0 +1,19 @@
{{ define "main" -}}
<ul class="posts">
<h1>Category: {{ .Title }}</h1>
{{ $regularPages := .Data.Pages -}}
{{ $pagesNotHidden := where $regularPages ".Params.hidden" "==" false }}
{{ $pagesHiddenUnset := where $regularPages ".Params.hidden" "==" nil }}
{{ $pages := $pagesNotHidden | union $pagesHiddenUnset }}
{{ range $pages -}}
<li>
<span>
<a href="{{ .Permalink }}">{{ .Title }}</a>
<time class="pull-right post-list" datetime="{{ .Date.Format "2006-01-02T15:04:05Z0700" }}">{{ .Date.Format "Jan 2, 2006" }}</time>
</span>
</li>
{{- end }}
</ul>
{{- end }}

View File

@ -1,11 +1,19 @@
{{ define "main" -}} {{ define "main" -}}
<ul class="posts"> <ul class="posts">
<h1>{{ .Title }}</h1> <h1>{{ .Title }}</h1>
{{ range .Data.Pages -}} {{ $regularPages := .Data.Pages -}}
{{ $pagesNotHidden := where $regularPages ".Params.hidden" "==" false }}
{{ $pagesHiddenUnset := where $regularPages ".Params.hidden" "==" nil }}
{{ $pages := $pagesNotHidden | union $pagesHiddenUnset }}
{{ range $pages -}}
<li> <li>
<span> <span>
<a href="{{ .Permalink }}">{{ .Title }}</a> <a href="{{ .Permalink }}">{{ .Title }}</a>
{{ if eq .Kind "page" }}
<time class="pull-right post-list" datetime="{{ .Date.Format "2006-01-02T15:04:05Z0700" }}">{{ .Date.Format "Jan 2, 2006" }}</time> <time class="pull-right post-list" datetime="{{ .Date.Format "2006-01-02T15:04:05Z0700" }}">{{ .Date.Format "Jan 2, 2006" }}</time>
{{ end }}
</span> </span>
</li> </li>
{{- end }} {{- end }}

View File

@ -0,0 +1,19 @@
{{ define "main" -}}
<ul class="posts">
<h1>Tag: {{ .Title }}</h1>
{{ $regularPages := .Data.Pages -}}
{{ $pagesNotHidden := where $regularPages ".Params.hidden" "==" false }}
{{ $pagesHiddenUnset := where $regularPages ".Params.hidden" "==" nil }}
{{ $pages := $pagesNotHidden | union $pagesHiddenUnset }}
{{ range $pages -}}
<li>
<span>
<a href="{{ .Permalink }}">{{ .Title }}</a>
<time class="pull-right post-list" datetime="{{ .Date.Format "2006-01-02T15:04:05Z0700" }}">{{ .Date.Format "Jan 2, 2006" }}</time>
</span>
</li>
{{- end }}
</ul>
{{- end }}