Add series-summary.html and use .Render in taxonomy

This commit is contained in:
BBaoVanC 2021-11-14 18:57:23 -06:00
parent ef8559d923
commit 8f36ba7368
Signed by: bbaovanc
GPG Key ID: 18089E4E3CCF1D3A
2 changed files with 41 additions and 39 deletions

View File

@ -0,0 +1,40 @@
<div class="post">
<h2 class="post-title">
{{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }}
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
</h2>
<div class="post-metadata">
{{ partial "translations-meta-item.html" . }}
{{ if ne .Site.Params.readingtime false }}
<span class="post-meta-item">
{{ partial "icon.html" "clock" }}
{{ $readingtime := 0 }}
{{ range .Data.Pages }}
{{ $readingtime = (add $readingtime .ReadingTime) }}
{{ end }}
{{ i18n "readingtime" $readingtime }}
</span>
{{ end }}
{{ partial "viewsource-meta-item.html" . }}
</div>
<div class="post-description">
{{ with .Description }}
<p>
{{ . | markdownify }}
</p>
{{ end }}
</div>
<div class="series-pages">
<ul>
{{ range .Data.Pages.Reverse }}
<li>{{ .Render "summary" }}</li>
{{ end }}
</ul>
</div>
</div>

View File

@ -28,45 +28,7 @@
<div class="series-taxonomy"> <div class="series-taxonomy">
<ul> <ul>
{{ range .Pages }} {{ range .Pages }}
<li> <li>{{ .Render "series-summary" }}</li>
<div class="post">
<h2 class="post-title">
{{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }}
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
</h2>
<div class="post-metadata">
{{ partial "translations-meta-item.html" . }}
{{ if ne .Site.Params.readingtime false }}
<span class="post-meta-item">
{{ partial "icon.html" "clock" }}
{{ $readingtime := 0 }}
{{ range .Data.Pages }}
{{ $readingtime = (add $readingtime .ReadingTime) }}
{{ end }}
{{ i18n "readingtime" $readingtime }}
</span>
{{ end }}
{{ partial "viewsource-meta-item.html" . }}
</div>
{{ with .Description }}
<div class="post-description">
<p>{{ . | markdownify }}</p>
</div>
{{ end }}
<div class="series-pages">
<ul>
{{ range .Data.Pages.Reverse }}
<li>{{ .Render "summary" }}</li>
{{ end }}
</ul>
</div>
</div>
</li>
{{ end }} {{ end }}
</ul> </ul>
</div> </div>