hugo-theme-re-terminal/layouts/_default/index.html

69 lines
2.0 KiB
HTML
Raw Normal View History

2022-06-21 13:50:51 +00:00
{{ define "main" }}
{{ if .Content }}
<div class="index-content {{ if .Params.framed -}}framed{{- end -}}">
{{ .Content }}
</div>
{{ end }}
<div class="posts">
{{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }}
{{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "posts" }}
{{ $PageContext := . }}
{{ if .IsHome }}
{{ $PageContext = .Site }}
{{ end }}
{{ $paginator := .Paginate (where $PageContext.RegularPages "Type" $contentTypeName) }}
{{ range $paginator.Pages }}
2022-10-22 11:29:33 +00:00
<article class="post on-list">
2022-06-21 13:50:51 +00:00
<h1 class="post-title">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
</h1>
2022-10-22 11:29:33 +00:00
2022-06-21 13:50:51 +00:00
<div class="post-meta">
2023-06-09 22:27:17 +00:00
{{- if .Date -}}
2022-10-22 11:29:33 +00:00
<time class="post-date">
2023-06-09 22:27:17 +00:00
{{- .Date.Format "2006-01-02" -}}
2022-10-22 11:29:33 +00:00
</time>
2023-06-09 22:27:17 +00:00
{{- end -}}
{{- with .Params.Author -}}
2022-10-24 14:31:41 +00:00
<span class="post-author">{{ . }}</span>
2023-06-09 22:27:17 +00:00
{{- end -}}
<!-- comments counter -->
{{ partial "comments_counter.html" . }}
2022-06-21 13:50:51 +00:00
</div>
{{ if .Params.tags }}
<span class="post-tags">
{{ range .Params.tags }}
#<a href="{{ (urlize (printf "tags/%s/" . )) | absLangURL }}">
{{- . -}}
</a>&nbsp;
{{ end }}
</span>
{{ end }}
{{ partial "cover.html" . }}
<div class="post-content">
{{ if .Params.showFullContent }}
{{ .Content }}
{{ else if .Description }}
{{ .Description | markdownify }}
{{ else }}
2023-01-21 15:20:14 +00:00
{{ .Summary }}
2022-06-21 13:50:51 +00:00
{{ end }}
</div>
{{ if not .Params.showFullContent }}
2022-10-22 11:29:33 +00:00
<div>
<a class="read-more button" href="{{.RelPermalink}}">{{ $.Site.Params.ReadMore }} →</a>
</div>
2022-06-21 13:50:51 +00:00
{{ end }}
2022-10-22 11:29:33 +00:00
</article>
2022-06-21 13:50:51 +00:00
{{ end }}
2022-10-22 11:29:33 +00:00
2022-06-21 13:50:51 +00:00
{{ partial "pagination.html" . }}
</div>
{{ end }}