Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/LordMathis/hugo-theme-nix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZach Smith <zsmith32@vt.edu>2021-06-08 22:28:29 +0300
committerZach Smith <zsmith32@vt.edu>2021-06-08 22:28:29 +0300
commit97a3d8bbb4525487f4dcd04365694b187da918db (patch)
tree5f2bac9f2386ab3a4e3c1d3f6d918afeb1e97382 /layouts
parent405d41426353c5cfcd0d5f212469fe669f296e27 (diff)
make postlist partial so we can use it elsewhere
Diffstat (limited to 'layouts')
-rw-r--r--layouts/_default/list.html17
-rw-r--r--layouts/partials/postlist.html16
2 files changed, 17 insertions, 16 deletions
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index fed1e8a..2faa62e 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -16,22 +16,7 @@
<h1 id=>{{ .Title }}</h1>
</div>
</div>
- <ul id="post-list">
- {{ range .Paginator.Pages }}
- <li>
- <div class="post-list-item">
- <div class="post-header">
- <h4 class="post-link"><a href="{{ .Permalink }}">{{ .Title }}</a></h4>
- <h4 class="post-date">{{ .Date.Format "2006-01-02" }}</h4>
- </div>
- <div class="post-summary"><p>{{ .Summary }}</p></div>
- <div class="post-list-footer text-center">
- <a href="{{ .Permalink }}">{{ i18n "read-more" }}</a>
- </div>
- </div>
- </li>
- {{ end }}
- </ul>
+ {{ partial "postlist.html" . }}
{{ partial "pagination" . }}
</div>
{{ partial "footer.html" . }}
diff --git a/layouts/partials/postlist.html b/layouts/partials/postlist.html
new file mode 100644
index 0000000..ab0da04
--- /dev/null
+++ b/layouts/partials/postlist.html
@@ -0,0 +1,16 @@
+<ul id="post-list">
+ {{ range .Paginator.Pages }}
+ <li>
+ <div class="post-list-item">
+ <div class="post-header">
+ <h4 class="post-link"><a href="{{ .Permalink }}">{{ .Title }}</a></h4>
+ <h4 class="post-date">{{ .Date.Format "2006-01-02" }}</h4>
+ </div>
+ <div class="post-summary"><p>{{ .Summary }}</p></div>
+ <div class="post-list-footer text-center">
+ <a href="{{ .Permalink }}">{{ i18n "read-more" }}</a>
+ </div>
+ </div>
+ </li>
+{{ end }}
+</ul>