
This commit changes targeted styling of `a` element to a class-based styling. This way, this is style is reusable on other elements and another `<a>` element can be used inside a `post-item`. Otherwise, if someone would need to use `<a>` element in a post item, then he would get all other styles (such as `display:flex`) on every `<a>` which is unexpected. This commit ensures that the style is abstracted from the element type itself, giving more flexibility when overriding the theme, and increases maintainability by making the intent more clear.
35 lines
1.3 KiB
HTML
35 lines
1.3 KiB
HTML
{{ define "main" }}
|
|
{{ $paginator := .Paginate .Data.Pages }}
|
|
|
|
<main class="posts">
|
|
<h1>{{ .Title }}</h1>
|
|
|
|
{{ if .Content }}
|
|
<div class="content">{{ .Content }}</div>
|
|
{{ end }}
|
|
|
|
{{ range $paginator.Pages.GroupByDate "2006" }}
|
|
<div class="posts-group">
|
|
<div class="post-year">{{ .Key }}</div>
|
|
|
|
<ul class="posts-list">
|
|
{{ range .Pages }}
|
|
<li class="post-item">
|
|
<a href="{{.Permalink}}" class="post-item-inner">
|
|
<span class="post-title">{{.Title}}</span>
|
|
<span class="post-day">
|
|
{{ if .Site.Params.dateformShort }}
|
|
{{ .Date.Format .Site.Params.dateformShort }}
|
|
{{ else }}
|
|
{{ .Date.Format "Jan 2"}}
|
|
{{ end }}
|
|
</span>
|
|
</a>
|
|
</li>
|
|
{{ end }}
|
|
</ul>
|
|
</div>
|
|
{{ end }}
|
|
{{ partial "pagination-list.html" . }}
|
|
</main>
|
|
{{ end }}
|