Fix list page and keep list simple
This commit is contained in:
parent
e6d8fd1b4e
commit
0a7745a3fe
@ -3,43 +3,16 @@
|
||||
{{ .Content }}
|
||||
<div class="title-header">
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{ with .OutputFormats.Get "rss" -}}
|
||||
<a href="{{ .Permalink | safeURL }}">RSS</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{- if gt (len .Sections) 0 }}
|
||||
<h2>Categories</h2>
|
||||
<ul class="section-list">
|
||||
{{- range .Sections }}
|
||||
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
|
||||
{{- end }}
|
||||
<ul>
|
||||
{{ range .Pages }}
|
||||
<li>
|
||||
<time>{{ .Date.Format "2006/01/02" }}</time>
|
||||
<a href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
<h2>All Posts</h2>
|
||||
{{- end }}
|
||||
{{- $cs := .CurrentSection }}
|
||||
{{- with $cs }}
|
||||
{{- range (where .Site.RegularPages "Section" .Section) }}
|
||||
{{- if .IsDescendant $cs }}
|
||||
<article class="all-list">
|
||||
<div class="title-list">
|
||||
<h3><a href="{{ .RelPermalink }}">{{ if .Draft }}<i>(Draft)</i> {{ end }}{{ .Title }}</a></h3>
|
||||
<div class="title-list-date">
|
||||
{{- if eq .Date.IsZero false }}
|
||||
<time>{{ .Date.Format "Monday, January 2, 2006" }}</time>
|
||||
{{- end }}
|
||||
{{- if (and (eq .Lastmod.IsZero false) (ne .Lastmod .Date)) }}
|
||||
(updated)
|
||||
{{- end }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="body-list">
|
||||
<p></p> {{/* Spacing is weird if we don't include this */}}
|
||||
<p>
|
||||
{{ .Summary }}
|
||||
</p>
|
||||
{{- if .Truncated }}
|
||||
<a href="{{ .RelPermalink }}">Read More…</a>
|
||||
{{- end }}
|
||||
</div>
|
||||
</article>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{ end }}
|
||||
|
@ -12,6 +12,12 @@
|
||||
<a class="btn" href="/tags/{{ . | urlize }}" role="button">{{ . }}</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{ if .Params.categories }}
|
||||
│
|
||||
{{range .Params.categories}}
|
||||
<a class="btn" href="/categories/{{ . | urlize }}" role="button">{{ . }}</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{- if (and (eq .Lastmod.IsZero false) (ne .Lastmod .Date)) }}
|
||||
— last updated <time>{{ .Lastmod.Format "January 2, 2006" }}</time>
|
||||
{{- end }}
|
||||
|
@ -1,31 +1,12 @@
|
||||
{{ define "main" }}
|
||||
{{ .Content }}
|
||||
{{ if gt ( len ( where .Site.RegularPages "Section" "posts" )) 0 }}
|
||||
<h2>Recent Posts</h2>
|
||||
{{ range first 2 ( where .Site.RegularPages "Section" "posts" ) }}
|
||||
<article class="all-list">
|
||||
<div class="title-list">
|
||||
<h3><a href="{{ .RelPermalink }}">{{ if .Draft }}<i>(Draft)</i> {{ end }}{{ .Title }}</a></h3>
|
||||
<div class="title-list-date">
|
||||
{{ if eq .Date.IsZero false }}
|
||||
<time>{{ .Date.Format "Monday, January 2, 2006" }}</time>
|
||||
{{ end }}
|
||||
{{ if (and (eq .Lastmod.IsZero false) (ne .Lastmod .Date)) }}
|
||||
(updated)
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="body-list">
|
||||
<p></p> {{/* Spacing is weird if we don't include this */}}
|
||||
<p>
|
||||
{{ .Summary }}
|
||||
</p>
|
||||
{{ if .Truncated }}
|
||||
<a href="{{ .RelPermalink }}">Read More…</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
<hr>
|
||||
</article>
|
||||
{{ end }}
|
||||
<h2>Posts</h2>
|
||||
<ul>
|
||||
{{ range first 100 ( where .Site.RegularPages "Section" "posts" ) }}
|
||||
<li>
|
||||
<time>{{ .Date.Format "2006/01/02" }}</time>
|
||||
<a href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user