Merge 59c814ce25ec48c782a92fbd0e28d947d7127e4c into b288ede80cbd70151e2f07f2e09ad6258e64f7fa

This commit is contained in:
Roneo.org 2023-11-29 17:19:12 -07:00 committed by GitHub
commit 75003c1c8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 37 additions and 0 deletions

View File

@ -296,6 +296,18 @@
margin-top: 56px;
}
.post-footer h3 {
margin: 2em 0 1.2em;
}
.post-footer .related ul {
padding-inline-start: 20px;
}
.post-footer .related a:hover {
box-shadow: 0 1px;
}
.post-tags li {
display: inline-block;
margin-inline-end: 3px;

View File

@ -31,3 +31,6 @@
- id: code_copied
translation: "copied!"
- id: related
translation: "Related posts"

View File

@ -31,3 +31,6 @@
- id: code_copied
translation: "Copié !"
- id: related
translation: "Sur le même sujet"

View File

@ -36,6 +36,12 @@
{{- end }}
<footer class="post-footer">
{{/* Show related posts */}}
{{- if (.Param "ShowRelatedContent") }}
{{- partial "related.html" . }}
{{- end }}
{{- $tags := .Language.Params.Taxonomies.tag | default "tags" }}
<ul class="post-tags">
{{- range ($.GetTerms $tags) }}

View File

@ -0,0 +1,13 @@
{{ $related := first 5 (where (where .Site.Pages ".Params.tags" "intersect" .Params.tags) "Permalink" "!=" .Permalink) }}
{{ with $related }}
<div class="related">
<h3 class="see-also">{{- i18n "related" -}}</h3>
<ul>
{{ range . }}
<li>
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
</li>
{{ end }}
</ul>
</div>
{{ end }}