feat: recent posts on index, CSS and HTML improvements

This commit is contained in:
2026-02-22 15:22:32 +01:00
parent 668294d5bb
commit 6fd705e70e
5 changed files with 102 additions and 35 deletions

View File

@@ -88,7 +88,7 @@
{{ .Summary }} <a class="learn-more" href="{{ .RelPermalink }}"></a>
</div>
{{ end }}
{{ template "_internal/pagination.html" . }}
<div id="pagination">{{ template "_internal/pagination.html" . }}</div>
</div>
</div>
</div>

View File

@@ -2,19 +2,20 @@
<body>
<div id="wrap">
{{ partial "header" . }}
<section id="about">
<section class="index" id="about">
<div class="container">
<div class="avatar">
<img class="img-circle" src="{{ .Site.BaseURL }}img/{{ .Site.Params.avatar }}" alt="Responsive image">
</div>
{{ .Content }}
<div id="index-content">
<div class="avatar">
<img class="img-circle" src="{{ .Site.BaseURL }}img/{{ .Site.Params.avatar }}" alt="Responsive image">
</div>
{{ partial "comments" . }}
{{ partial "social" . }}
{{ .Content }}
</div>
</section>
</div>
{{ partial "recent" . }}
</div>
</section>
</div>
{{ partial "social" . }}
{{ partial "footer" . }}
{{ partial "js" . }}
{{ partial "matomo" . }}

View File

@@ -0,0 +1,21 @@
{{- $lastno := 3 }}
{{- $size := sub 12 $lastno -1 }}
{{- $id := 0 }}
{{- $pages := .Site.RegularPages.ByDate.Reverse | first $lastno }}
<div id="recent-posts">
{{- range $pages }}
<div class="row">
<div class="card col-xs-12 col-sm-{{ $size }} col-sm-offset-{{ $id }}">
<h4 class="card-title">
{{ partial "blog/pre-headline.html" . -}}
<a href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a>
</h4>
<div class="metadata-summary">
{{- partial "blog/verb.html" . }}
on {{ .Date.Format "2 January 2006" }} - {{ range $i, $tag := .Params.tags }}{{ if $i }}, {{ end }}<a href="/tags/{{ lower $tag }}">#{{ $tag }}</a>{{ end }}
</div>
</div>
</div>
{{- $id = add $id 1 -}}
{{- end }}
</div>