Backlinks, outgoing URLs, bibliographic references and internal links:
{{ $s := partialCached "scratch.html" . }}
[toggle expand/collapse]
{{ range $p := .Site.RegularPages }}
{{ with $p.File }}{{- substr .Dir 0 -1 -}}⁄{{ end }}{{ $p.Title }}
{{ $pPath := printf "/%s" $p.File }}
{{ with $ss := $s.Get $pPath }}
{{ with $ss.backlinks }}
{{ range $i, $_ := $ss.backlinks }}
{{ if eq $i 0 }}
Mentioned in other Sandpoints pages ({{ len $ss.backlinks }}):
{{ end }}
{{ with $_.File }}{{ substr .Dir 0 -1 }}⁄{{ end }}{{ $_.Title }}
{{ end }}
{{ end }}
{{ end }}
{{ with ($p.Scratch.Get "links") }}
{{ range $i, $_ := uniq ($p.Scratch.Get "links") }}
{{ if eq $i 0 }}
Internal links to other Sandpoint pages ({{ len (uniq ($p.Scratch.Get "links")) }}):
{{ end }}
{{ with $_.File }}{{ substr .Dir 0 -1 }}⁄{{ end }}{{ $_.Title }}
{{ end }}
{{ end }}
{{ $http_links := (slice) }}
{{ $library_links := (slice) }}
{{ $anchor_links := (slice) }}
{{ $other_links := (slice) }}
{{ with ($p.Scratch.Get "urls") }}
{{- $c_prefix := $p.Site.Params.sandpointsCatalogPrefix | default "/library/" -}}
{{ range $i, $_ := ($p.Scratch.Get "urls") }}
{{ if strings.HasPrefix $_ "http" }}
{{ $http_links = $http_links | append $_ }}
{{ else if strings.HasPrefix $_ $c_prefix }}
{{ $library_links = $library_links | append $_ }}
{{ else}}
{{ $other_links = $other_links | append $_ }}
{{ end }}
{{ end }}
{{ end }}
{{ with $http_links }}
{{ range $i, $_ := $http_links }}
{{ if eq $i 0 }}
Outgoing links to other pages on Internet ({{ len $http_links }}):