diff --git a/layouts/partials/singlebody.html b/layouts/partials/singlebody.html index 9e4eaf3..e598157 100644 --- a/layouts/partials/singlebody.html +++ b/layouts/partials/singlebody.html @@ -9,7 +9,8 @@ {{ $scratch := $s.Get $currentFile }} {{ $sandnamePlural := (slice) }} - +{{ $sandnameSingular := "" }} +{{ $mentionLink := "" }}
{{ substr $currentDir 0 -1 }}⁄{{ substr .Title 0 1 }}{{ substr .Title 1 }}
@@ -32,12 +33,17 @@ {{ $mentions := intersect $paramsKeys $sandnamePlural }} {{ range $mention := $mentions }} {{ range $k, $m := index $currentNode.Params $mention }} - {{ $mentionLink := printf "/%s/%s" (substr $mention 0 -1) $m }} + {{ range $k, $v := $.Site.Data.sandpointsnamegraph }} + {{ if eq $v $mention }} + {{ $mentionLink = printf "/%s/%s" $k $m }} + {{ $sandnameSingular = $k }} + {{ end }} + {{ end }} {{- with $.GetPage $mentionLink -}} {{- with not $k -}} {{ $closeDivs = true }}
-
{{ with (index $currentNode.Params $mention) }}{{ if gt (len (index $currentNode.Params $mention)) 1 }}{{ $mention }}{{ else }}{{ substr $mention 0 -1 }}{{ end }}{{ end }}⁄
+
{{ with (index $currentNode.Params $mention) }}{{ if gt (len (index $currentNode.Params $mention)) 1 }}{{ $mention }}{{ else }}{{ $sandnameSingular }}{{ end }}{{ end }}⁄
{{- end -}}