backlinks for authors from page params
This commit is contained in:
parent
132f0b7945
commit
a22b6d0683
1 changed files with 11 additions and 0 deletions
|
@ -23,6 +23,17 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
{{ with $authors := $p.Params.authors }}
|
||||||
|
{{ range $author := $authors }}
|
||||||
|
{{ $authorLink := printf "/author/%s" $author }}
|
||||||
|
{{ with ($_.Get $authorLink) }}
|
||||||
|
{{ $_.SetInMap $authorLink "backlinks" (uniq ((index ($_.Get $authorLink) "backlinks") | append $p)) }}
|
||||||
|
{{ else }}
|
||||||
|
{{ $_.SetInMap $authorLink "backlinks" (slice $p) }}
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
{{ $gp := $.GetPage $pPath }}
|
{{ $gp := $.GetPage $pPath }}
|
||||||
{{ $gpPath := printf "/%s" $gp.File }}
|
{{ $gpPath := printf "/%s" $gp.File }}
|
||||||
{{ range $k, $v := $gp.Params }}
|
{{ range $k, $v := $gp.Params }}
|
||||||
|
|
Loading…
Add table
Reference in a new issue