40 lines
935 B
HTML
40 lines
935 B
HTML
{{- /*
|
|
Displays a list of external links
|
|
|
|
@params pc Page context
|
|
@params sc Site context
|
|
*/
|
|
-}}
|
|
|
|
|
|
<!-- Variable assignment -->
|
|
|
|
{{- $params := . -}}
|
|
|
|
|
|
<!-- Validation -->
|
|
|
|
{{- if ( not ( isset $params "sc" ) ) -}}
|
|
{{- errorf "No site context received" -}}
|
|
{{- end -}}
|
|
|
|
{{- if ( not ( isset $params "pc" ) ) -}}
|
|
{{- errorf "No page context received (%q)" $params.sc.Page.File.Dir -}}
|
|
{{- end -}}
|
|
|
|
|
|
<!-- Rendering -->
|
|
|
|
<h3>External Links</h3>
|
|
<ul>
|
|
{{- range $params.pc.Params.external_links -}}
|
|
{{ if eq ( printf "%T" . ) "map[string]interface {}" }}
|
|
{{ if ( isset . "name" ) }}
|
|
{{- errorf "Name is set (%q)" $params.sc.Page.File.Dir -}}
|
|
{{ end }}
|
|
{{- partial "single/main-body/links/link/title-link.html" ( $params | merge ( dict "title" .title "link" .link ) ) }}
|
|
{{ else }}
|
|
{{- partial "single/main-body/links/link/basic-link.html" $params }}
|
|
{{ end }}
|
|
{{- end -}}
|
|
</ul>
|