get internal links from page resources
This commit is contained in:
parent
e9185cf1e5
commit
5aec4874b6
1 changed files with 9 additions and 1 deletions
|
@ -84,7 +84,15 @@
|
||||||
<ul>
|
<ul>
|
||||||
{{- range . -}}
|
{{- range . -}}
|
||||||
{{ if eq ( printf "%T" . ) "map[string]interface {}" }}
|
{{ if eq ( printf "%T" . ) "map[string]interface {}" }}
|
||||||
<li><a href="{{ .link }}">{{ .title | safeHTML }}</a></li>
|
{{- if .src -}}
|
||||||
|
{{- $src := $.Page.Resources.GetMatch .src -}}
|
||||||
|
{{- if ( not $src ) -}}
|
||||||
|
{{- errorf "No Page Resource found for src '%q' (%q).\n\n\tAvailable Page Resources are:\n\t\t%v" ( $.Get .src ) $.Page.File.Path $.Page.Resources -}}
|
||||||
|
{{- end -}}
|
||||||
|
<li><a href="{{ $src.RelPermalink }}">{{ .title | $.RenderString | safeHTML }}</a></li>
|
||||||
|
{{- else -}}
|
||||||
|
<li><a href="{{ .link }}">{{ .title | $.RenderString | safeHTML }}</a></li>
|
||||||
|
{{- end -}}
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<li><a href="{{ . }}">Link</a></li>
|
<li><a href="{{ . }}">Link</a></li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue