Skip to content

Commit

Permalink
fix: Move the post list on list pages out of <header>
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushalmodi committed Apr 6, 2022
1 parent f043202 commit 202db77
Showing 1 changed file with 28 additions and 30 deletions.
58 changes: 28 additions & 30 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,43 +5,38 @@ <h1>{{ site.Title }}</h1>
{{ with site.Params.Description }}
<p>{{ . }} </p>
{{ end }}
{{ else }}
<h1>Posts in ‘{{ .Section }}’</h1>
{{ end }}
</header>
{{ end }}

{{ define "main" }}
<main>
<section>
<ul>
{{ range site.RegularPages.ByLastmod.Reverse }}
<li>
<a href="{{ .Permalink }}">{{ .Title }}</a>
{{ if (not .Date.IsZero) }}
<small>
{{ if .IsHome }}
<small>
<time datetime="{{ dateFormat "Jan 2, 2006" .Date }}">
{{ dateFormat "Jan 2, 2006" .Date }}
</time>
</small>
{{ else }}
<time datetime="{{ dateFormat "Jan 2, 2006" .Date }}">
{{ dateFormat "Jan 2, 2006" .Date }}
</time>
</small>
{{ end }}
{{ end }}
</li>
{{ end }}
</ul>
{{ else }}
<h1>Posts in ‘{{ .Section }}’</h1>

<ul>
{{ range site.RegularPages.ByLastmod.Reverse }}
<li>
<a href="{{ .Permalink }}">{{ .Title }}</a>
{{ if (not .Date.IsZero) }}
<time datetime="{{ dateFormat "Jan 2, 2006" .Date }}">
{{ dateFormat "Jan 2, 2006" .Date }}
</time>
{{ end }}
</li>
{{ end }}
</ul>
{{ end }}
</header>
{{ end }}
</section>

{{ define "main" }}
<main>
<section>
{{ with .Content }}
{{ . }}
Expand All @@ -51,13 +46,16 @@ <h1>Posts in ‘{{ .Section }}’</h1>
{{ end }}

{{ define "footer" }}
{{ range .AlternativeOutputFormats }}
{{ $name_upper := .Name | upper }}
{{ if (or (eq $name_upper "RSS") (eq $name_upper "ATOM")) }}
<hr>
<footer>
<footer>
{{ if (not .IsHome) }}
<a href="{{ site.BaseURL }}">← home</a>
{{ end }}
<hr>
{{ range .AlternativeOutputFormats }}
{{ $name_upper := .Name | upper }}
{{ if (or (eq $name_upper "RSS") (eq $name_upper "ATOM")) }}
{{ printf `<a href="%s">%s</a>` .Permalink $name_upper | safeHTML }}
</footer>
{{ end }}
{{ end }}
{{ end }}
</footer>
{{ end }}

0 comments on commit 202db77

Please sign in to comment.