4 |
24 | {{- $isHidden := .Params.cover.hidden | default site.Params.cover.hiddenInSingle | default site.Params.cover.hidden }}
25 | {{- partial "cover.html" (dict "cxt" . "IsHome" false "isHidden" $isHidden) }}
26 | {{- if (.Param "ShowToc") }}
27 | {{- partial "toc.html" . }}
28 | {{- end }}
29 |
30 | {{- if .Content }}
31 |
32 | {{- if not (.Param "disableAnchoredHeadings") }}
33 | {{- partial "anchored_headings.html" .Content -}}
34 | {{- else }}{{ .Content }}{{ end }}
35 |
36 | {{- end }}
37 |
38 |
49 |
50 | {{- if (.Param "comments") }}
51 | {{- partial "comments.html" . }}
52 | {{- end }}
53 |
54 |
55 | {{- end }}{{/* end main */}}
--------------------------------------------------------------------------------
/layouts/partials/backlinks.html:
--------------------------------------------------------------------------------
1 | {{ $backlinks := slice }}
2 | {{ $path_base := .page.File.ContentBaseName }}
3 | {{ $path_base_re := printf `["/(]%s["/)]` $path_base }}
4 |
5 | {{ range where site.RegularPages "RelPermalink" "ne" .page.RelPermalink }}
6 | {{ if (findRE $path_base_re .RawContent 1) }}
7 | {{ $backlinks = $backlinks | append . }}
8 | {{ end }}
9 | {{ end }}
10 |
11 | {{ with $backlinks }}
12 |