Update index page to link to all posts

This commit is contained in:
Alex Selimov 2025-07-11 23:14:20 -04:00
parent 5a2b4c0f1f
commit f57ac2b8cc
Signed by: aselimov
GPG key ID: 3DDB9C3E023F1F31
2 changed files with 32 additions and 30 deletions

View file

@ -4,34 +4,37 @@ theme = "hugo-theme-terminal"
pagination.pagerSize = 5
[markup.goldmark.renderer]
unsafe = true
unsafe = true
[params]
contentTypeName = "posts"
showMenuItems = 2
fullWidthTheme = false
centerTheme = false
contentTypeName = "posts"
showMenuItems = 2
postsToShowOnIndex = 3
fullWidthTheme = false
centerTheme = false
[languages]
[languages.en]
title = "Terminal"
subtitle = "A simple, retro theme for Hugo"
keywords = ""
copyright = ""
menuMore = "Show more"
readMore = "Read more"
readOtherPosts = "Read other posts"
[languages.en]
title = "Terminal"
subtitle = "A simple, retro theme for Hugo"
keywords = ""
copyright = ""
[languages.en.params.logo]
logoText = "Terminal"
logoHomeLink = "/"
[languages.en.params]
menuMore = "Show more"
readMore = "Read more"
readOtherPosts = "Read other posts"
[languages.en.menu]
[[languages.en.menu.main]]
identifier = "about"
name = "About"
url = "/about"
[[languages.en.menu.main]]
identifier = "showcase"
name = "Showcase"
url = "/showcase"
[languages.en.params.logo]
logoText = "Terminal"
logoHomeLink = "/"
[languages.en.menu]
[[languages.en.menu.main]]
identifier = "about"
name = "About"
url = "/about"
[[languages.en.menu.main]]
identifier = "showcase"
name = "Showcase"
url = "/showcase"

View file

@ -12,9 +12,7 @@
{{ if .IsHome }}
{{ $PageContext = .Site }}
{{ end }}
{{ $paginator := .Paginate (where $PageContext.RegularPages "Type" $contentTypeName) }}
{{ range $paginator.Pages }}
{{ range ( where .Site.RegularPages "Type" "posts" | first .Site.Params.postsToShowOnIndex) }}
<article class="post on-list">
<h2 class="post-title">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
@ -60,7 +58,8 @@
{{ end }}
</article>
{{ end }}
{{ partial "pagination.html" . }}
<center>
<a href="/posts" class="button inline" >[Go to all posts]</a>
</center>
</div>
{{ end }}