26 lines
898 B
HTML
26 lines
898 B
HTML
|
{{ if .Param "mentionedin" }}
|
||
|
{{ if in (.Site.Param "postSections" | default (slice "posts")) .Type }}
|
||
|
{{ $mentionedIn := slice }}
|
||
|
{{ $current := .RelPermalink }}
|
||
|
{{ range .Sites }}
|
||
|
{{ $allPages := ( where .RegularPages "Type" "in" (.Param "postSections" | default (slice "posts")) ) }}
|
||
|
{{ range $allPages }}
|
||
|
{{ if strings.Contains .RawContent $current }}
|
||
|
{{ $mentionedIn = $mentionedIn | append . }}
|
||
|
{{ end }}
|
||
|
{{ end }}
|
||
|
{{ end }}
|
||
|
{{ with $mentionedIn }}
|
||
|
<div class="mentionedin">
|
||
|
<details>
|
||
|
<summary class="mentionedin-caption">{{ T "mentionedin" }}</summary>
|
||
|
<ul class="mentionedin-list">
|
||
|
{{ range sort . "Date" "desc" }}
|
||
|
<li><a href="{{ .RelPermalink }}">{{ with .Title }}{{ . }}{{ else }}{{ .Summary | truncate 60 }}{{ end }}</a> <i>{{.Date.Format ( .Site.Params.dateformat | default "January 02, 2006")}}</i></li>
|
||
|
{{ end }}
|
||
|
</ul>
|
||
|
</details>
|
||
|
</div>
|
||
|
{{ end }}
|
||
|
{{ end }}
|
||
|
{{ end }}
|