code home 09.08.25
·
2 mins read
info
File layouts\_default\home.html
current code
{{ define "main" }}
<main aria-role="main">
<header class="homepage-header">
{{ with .Params.subtitle }}
<span class="subtitle">{{ . }}</span>
{{ end }}
</header>
<div class="homepage-content">
{{ .Content }}
</div>
</main>
{{ end }}
previous code
{{ define "main" }}
<main aria-role="main">
<header class="homepage-header">
{{ with .Params.subtitle }}
<span class="subtitle">{{ . }}</span>
{{ end }}
</header>
<div class="homepage-content">
{{ .Content }}
</div>
{{ $key := "type" }}
{{ $value := "talks" }}
{{ $paramskey := (printf "Params.%s" $key) }}
{{ $filteredPages := .Site.RegularPages }}
{{ $allowedURLs := slice
"25g32"
"25f63"
"25e60" "25e44" "25e31"
"25c70"
}}
{{ $filteredPages := slice }}
{{ range .Site.RegularPages }}
{{ $pageURL := .Params.url }}
{{ if in $allowedURLs $pageURL }}
{{ $filteredPages = $filteredPages | append . }}
{{ end }}
{{ end }}
<!--
url https://chatgpt.com/share/676fcffa-931c-800a-8ae9-3363762a8316 [20241228].
-->
<div class="posts-box-container">
{{ $paginator := .Paginate $filteredPages }}
{{ range $paginator.Pages }}
<div class="homepage-posts-box">
<code class="homepage-post-date">
{{ dateFormat "02-Jan-2006" .Date }}
</code><br>
<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
</div>
{{ end }}
</div>
<!--
url https://chatgpt.com/share/674c42d8-7298-800a-9d2f-57af4c77c925 [20241201]
-->
<div class="pagination-container">
<div class="pagination">
<!-- "Previous" button -->
{{ if $paginator.HasPrev }}
<a href="{{ $paginator.Prev.URL }}" class="prev"> < </a>
{{ end }}
<!-- Numeric pagination -->
{{ range $paginator.Pagers }}
{{ if eq . $paginator }}
<span class="current">{{ printf "%02d" .PageNumber }}</span> <!-- Current page -->
{{ else }}
<a href="{{ .URL }}" class="page">{{ printf "%02d" .PageNumber }}</a>
{{ end }}
{{ end }}
<!-- "Next" button -->
{{ if $paginator.HasNext }}
<a href="{{ $paginator.Next.URL }}" class="next"> > </a>
{{ end }}
</div>
</div>
</main>
{{ end }}
notes
- Related note is 25h23 .