diff options
| author | Serghei Iakovlev <egrep@protonmail.ch> | 2022-05-08 18:47:25 +0200 |
|---|---|---|
| committer | Serghei Iakovlev <egrep@protonmail.ch> | 2022-05-08 18:47:25 +0200 |
| commit | b29419c9c72bbc2d605addabf0dfd84a7f41b88b (patch) | |
| tree | 4199578140684b30d7fb93e5c28b86db39442c83 /layouts/index.html | |
| parent | 40288d1362e1074c6e2c0d0d9de5a2d59bc86fb5 (diff) | |
| download | gohugo-theme-ed-b29419c9c72bbc2d605addabf0dfd84a7f41b88b.tar.gz | |
Provide ability to list posts on main page
Diffstat (limited to 'layouts/index.html')
| -rw-r--r-- | layouts/index.html | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/layouts/index.html b/layouts/index.html index e051c4d..2209872 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,20 +1,26 @@ -{{ define "main" -}} - -<div class="introduction"> - {{ .Content }} -</div> - -<hr> - -<div class="toc"> - <h2>Latest Publications</h2> - <ul class="texts"> - {{ range first 10 (where site.RegularPages "Section" "!=" "" ) }} - <li class="text-title"> - <a href="{{ .Permalink }}">{{ .Title }}</a> - </li> - {{ end }} - </ul> -</div> - +{{ define "main" }} +{{- with .Content }} + <div class="introduction"> + {{ . }} + </div> + <hr> + <div class="toc"> + {{/* TODO: Translate me */}} + <h2>Latest Publications</h2> + <ul class="texts"> + {{ range first 10 (where site.RegularPages "Section" "!=" "") }} + <li class="text-title"> + <a href="{{ .Permalink }}">{{ .Title }}</a> + </li> + {{ end }} + </ul> + </div> +{{- else }} + {{ $paginator := .Paginate (where site.RegularPages "Type" "in" site.Params.main_sections) }} + <div class="articles"> + {{- range $paginator.Pages }} + {{- .Render "teaser" }} + {{- end }} + </div> +{{- end }} {{- end }} |
