refactor: make article-list/compact better for term pages (#1289)
* refactor: rename article-time class to article-footer for consistency * feat: show the number of subpages in `article-compact` when the page is a term
This commit is contained in:
@@ -4,11 +4,23 @@
|
||||
<h2 class="article-title">
|
||||
{{- .Title -}}
|
||||
</h2>
|
||||
<footer class="article-time">
|
||||
<time datetime='{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}'>
|
||||
{{- .Date | time.Format (or .Site.Params.dateFormat.published "Jan 02, 2006") -}}
|
||||
</time>
|
||||
</footer>
|
||||
|
||||
{{- $description := .Params.description -}}
|
||||
{{- $IsTerm := in .Kind "term" -}}
|
||||
{{- if $IsTerm -}}
|
||||
{{- $description = $description | default (T "list.page" (len .Pages)) -}}
|
||||
{{- end -}}
|
||||
{{- if or $description (not .Date.IsZero) -}}
|
||||
<footer class="article-footer">
|
||||
{{- if not .Date.IsZero -}}
|
||||
<time datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
|
||||
{{- .Date | time.Format .Site.Params.dateFormat.published -}}
|
||||
</time>
|
||||
{{- else if $description -}}
|
||||
<span class="article-description">{{- $description -}}</span>
|
||||
{{ end }}
|
||||
</footer>
|
||||
{{- end -}}
|
||||
</div>
|
||||
|
||||
{{- $image := partial "helper/image" (dict "Image" .Params.image "Resources" .Resources) -}}
|
||||
|
||||
Reference in New Issue
Block a user