40 lines
		
	
	
	
		
			1.1 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
	
		
			1.1 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
{{- $imgs := slice -}}
 | 
						|
{{- $class := .Get "class" -}}
 | 
						|
{{- $shouldResize := .Get "shouldResize" | default true -}}
 | 
						|
{{- $shouldShowTitle := (.Get "shouldShowTitle") | default true -}}
 | 
						|
 | 
						|
{{- if .Get "name" -}}
 | 
						|
  {{- $imgs = $imgs | append (.Page.Resources.GetMatch (.Get "name")) -}}
 | 
						|
{{- else if .Get "names" -}}
 | 
						|
  {{- range (split (.Get "names") ",") -}}
 | 
						|
    {{- $imgs = $imgs | append ($.Page.Resources.GetMatch .) -}}
 | 
						|
  {{- end -}}
 | 
						|
{{- else -}}
 | 
						|
  {{ errorf "Missing name or names parameter to figures/image" }}
 | 
						|
{{- end -}}
 | 
						|
 | 
						|
{{- if lt (len $imgs) 0 -}}
 | 
						|
  {{ errorf "No images found for name(s) parameter" }}
 | 
						|
{{- end -}}
 | 
						|
 | 
						|
{{- $size := .Get "size" | default "full" -}}
 | 
						|
 | 
						|
{{ if in (slice "full" "main") $size }}
 | 
						|
  {{
 | 
						|
    partial "page/figures/fullwidth.html" (dict
 | 
						|
      "page" $.Page
 | 
						|
      "name" (.Get "name")
 | 
						|
      "size" $size
 | 
						|
      "shouldShowTitle" (.Get "shouldShowTitle" | default true)
 | 
						|
    )
 | 
						|
  }}
 | 
						|
{{ else if eq $size "small" }}
 | 
						|
  {{
 | 
						|
    partial "page/figures/small.html" (dict
 | 
						|
      "page" $.Page
 | 
						|
      "name" (.Get "name")
 | 
						|
      "size" $size
 | 
						|
      "shouldShowTitle" (.Get "shouldShowTitle" | default true)
 | 
						|
    )
 | 
						|
  }}
 | 
						|
{{ end }}
 |