hugo-theme-terminal

My Fork of the Terminal Hugo Theme
git clone https://git.repetitions.de/hugo-theme-terminal

index.html (2187B)


 1 {{ define "main" }}
 2   {{ partial "cover.html" . }}
 3   {{ if .Title }}
 4     <h1 class="post-title">
 5       <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
 6     </h1>
 7   {{ end }}
 8   {{ if .Content }}
 9     <div class="index-content {{ if .Params.framed -}}framed{{- end -}}">
10       {{ .Content }}
11     </div>
12   {{ end }}
13   {{ if not .Params.NoPosts }}
14   <div class="posts">
15     {{ $isntDefault := not (or (eq (trim $.Site.Params.contentTypeName " ") "posts") (eq (trim $.Site.Params.contentTypeName " ") "")) }}
16     {{ $contentTypeName := cond $isntDefault (string $.Site.Params.contentTypeName) "posts" }}
17 
18     {{ $PageContext := . }}
19     {{ if .IsHome }}
20       {{ $PageContext = .Site }}
21     {{ end }}
22     {{ $paginator := .Paginate (where $PageContext.RegularPages "Type" $contentTypeName) }}
23     {{ range $paginator.Pages }}
24       <article class="post on-list">
25         <h1 class="post-title">
26           <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
27         </h1>
28 
29         <div class="post-meta">
30           {{- if .Date -}}
31             <time class="post-date">
32               {{- .Date.Format "2006-01-02" -}}
33             </time>
34           {{- end -}}
35           {{- with .Params.Author -}}
36             <span class="post-author">{{ . }}</span>
37           {{- end -}}
38         </div>
39 
40         {{ if .Params.tags }}
41           <span class="post-tags">
42             {{ range .Params.tags }}
43             #<a href="{{ (urlize (printf "tags/%s/" . )) | absLangURL }}">
44               {{- . -}}
45             </a>&nbsp;
46             {{ end }}
47           </span>
48         {{ end }}
49 
50         {{ partial "cover.html" . }}
51 
52         <div class="post-content">
53           {{ if .Params.showFullContent }}
54             {{ .Content }}
55           {{ else if .Description }}
56             {{ .Description | markdownify }}
57           {{ else }}
58             {{ .Summary }}
59           {{ end }}
60         </div>
61 
62         {{ if not .Params.showFullContent }}
63           <div>
64             <a class="read-more button" href="{{.RelPermalink}}">{{ $.Site.Params.ReadMore }} →</a>
65           </div>
66         {{ end }}
67       </article>
68     {{ end }}
69 
70     {{ partial "pagination.html" . }}
71   </div>
72   {{ end }}
73 {{ end }}
74