Add backlinks to default page; fix bug
This commit is contained in:
@@ -4,4 +4,7 @@
|
||||
<h2>{{ .Title }}</h2>
|
||||
|
||||
{{ .Content }}
|
||||
|
||||
{{- partial "references.html" . -}}
|
||||
{{- partial "backlinks.html" . -}}
|
||||
{{ end }}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{{ $currlink := .RelPermalink }}
|
||||
{{ $noslash := substr .RelPermalink 0 -1 }}
|
||||
{{ $link := printf `href="%s` (substr .RelPermalink 0 -1) }}
|
||||
{{ $backlinks := slice }}
|
||||
|
||||
{{ range .Site.Pages }}
|
||||
{{ $found := findRE $noslash .Content 1 }}
|
||||
{{ $found := findRE $link .Content 1 }}
|
||||
|
||||
{{ if and ($found) (ne $currlink .RelPermalink) }}
|
||||
{{ $backlinks = $backlinks | append . }}
|
||||
|
||||
Reference in New Issue
Block a user