feat: recent posts on index, CSS and HTML improvements
This commit is contained in:
21
themes/hugo-sustain/layouts/partials/recent.html
Normal file
21
themes/hugo-sustain/layouts/partials/recent.html
Normal 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>
|
||||
Reference in New Issue
Block a user