Skip to content

Commit

Permalink
add 'See Also'
Browse files Browse the repository at this point in the history
  • Loading branch information
suihan74 committed Feb 16, 2021
1 parent 11b2588 commit 43a8a04
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions layouts/partials/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,32 @@ <h1 class="public css-truncate float-none flex-auto width-fit pl-0">
-->
</div>
</div>

{{ $related := .Site.RegularPages.RelatedIndices . "tags" "date" | first 5 }}
{{ with $related }}
<div class="Box mt-3 position-relative">
<div class="Box-body instapaper_body js-code-block-container">
<article class="markdown-body entry-content p-3 p-md-6" itemprop="text">
<h2>See Also</h2>
<ul class="mt-2">
{{ range . }}
<li class="p-1">
<div>
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
<time datetime="{{ .PublishDate.Format "2006-01-02 15:04" }}" class="no-wrap text-small ml-1">
{{ .PublishDate.Format "(2006-01-02 15:04)" }}
</time>
</div>
<div class="text-small text-gray mb-1 mt-1">
{{ .Description }}
</div>
</li>
{{ end }}
</ul>
</article>
</div>
</div>
{{ end }}
</div>
</div>
</main>
Expand Down

0 comments on commit 43a8a04

Please sign in to comment.