Added posts to main page, updated blog navigation with pagination
This commit is contained in:
parent
f4cfdd00f4
commit
9f3d6df16d
2 changed files with 39 additions and 6 deletions
|
@ -19,4 +19,26 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<main>
|
||||||
|
<div class="container">
|
||||||
|
<h2>Recent Blog Posts</h2>
|
||||||
|
{{ range first 3 .Site.RegularPages }}
|
||||||
|
<article>
|
||||||
|
<!-- this <div> includes the title summary -->
|
||||||
|
<div>
|
||||||
|
<h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
|
||||||
|
<tt>{{ .Date.Format "Jan 2, 2006" }}</tt><br/>
|
||||||
|
{{ .Summary }}
|
||||||
|
</div>
|
||||||
|
{{ if .Truncated }}
|
||||||
|
<!-- This <div> includes a read more link, but only if the summary is truncated... -->
|
||||||
|
<div>
|
||||||
|
<a href="{{ .RelPermalink }}">Read More…</a>
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
</article>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
|
||||||
{{ partial "footer.html" . }}
|
{{ partial "footer.html" . }}
|
|
@ -9,14 +9,25 @@
|
||||||
{{- block "main" . }}{{- end }}
|
{{- block "main" . }}{{- end }}
|
||||||
<h1>{{.Title}}</h1>
|
<h1>{{.Title}}</h1>
|
||||||
{{.Content}}
|
{{.Content}}
|
||||||
<ul>
|
|
||||||
<!-- Ranges through content/posts/*.md -->
|
<!-- Ranges through content/posts/*.md -->
|
||||||
{{ range .Pages }}
|
{{ range (.Paginator 10).Pages }}
|
||||||
<li>
|
<article>
|
||||||
<a href="{{.Permalink}}">{{.Date.Format "2006-01-02"}} | {{.Title}}</a>
|
<!-- this <div> includes the title summary -->
|
||||||
</li>
|
<div>
|
||||||
|
<h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
|
||||||
|
<tt>{{ .Date.Format "Jan 2, 2006" }}</tt><br/>
|
||||||
|
{{ .Summary }}
|
||||||
|
</div>
|
||||||
|
{{ if .Truncated }}
|
||||||
|
<!-- This <div> includes a read more link, but only if the summary is truncated... -->
|
||||||
|
<div>
|
||||||
|
<a href="{{ .RelPermalink }}">Read More…</a>
|
||||||
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ul>
|
</article>
|
||||||
|
{{ end }}
|
||||||
|
<br />
|
||||||
|
{{ template "_internal/pagination.html" . }}
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
{{- partial "footer.html" . -}}
|
{{- partial "footer.html" . -}}
|
||||||
|
|
Reference in a new issue