commit c7dfb029e14990cbb245a655fd2430c8d613e5c9
parent 5beb3eb5b4d761cfbe1c86fe36e34ce067288988
Author: Shimmy Xu <shimmy.xu@shimmy1996.com>
Date: Thu, 28 Jun 2018 10:14:20 -0500
Make render for <li>.
Diffstat:
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/layouts/_default/home.html b/layouts/_default/home.html
@@ -8,9 +8,9 @@
{{ .Content }}
<ul>
-{{ range (first 5 (where .Data.Pages "Section" "!=" "") ) }}
-<li>{{ partial "iso_date.html" .Date }} <a href="{{ .URL }}">{{.Title}}</a></li>
-{{ end }}
+ {{ range (first 5 (where .Data.Pages "Section" "!=" "") ) }}
+ {{ .Render "li" }}
+ {{ end }}
</ul>
{{ partial "footer.html" . }}
diff --git a/layouts/_default/li.html b/layouts/_default/li.html
@@ -0,0 +1 @@
+<li>{{ partial "iso_date.html" .Date }} <a href="{{ .URL }}">{{ .Title }}</a></li>
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
@@ -5,9 +5,9 @@
{{ .Content }}
<ul>
-{{ range (where .Data.Pages "Section" "!=" "") }}
- <li>{{ partial "iso_date.html" .Date }} <a href="{{ .URL }}">{{ .Title }}</a></li>
-{{ end }}
+ {{ range (where .Data.Pages "Section" "!=" "") }}
+ {{ .Render "li" }}
+ {{ end }}
</ul>
{{ partial "footer.html" . }}