get_logo.html 554 B

12345678910111213141516
  1. {{/* Function to get logo image. */}}
  2. {{/* Inputs: constraint: max_height/fit (str); size (int) */}}
  3. {{/* Output: resource (obj) */}}
  4. {{ $logo := resources.Get "images/logo.png" }}
  5. {{ $logo_proc := $logo }}
  6. {{ if eq .constraint "max_height" }}
  7. {{/* Resize logo to fit specified max height. */}}
  8. {{ $logo_proc = ($logo.Resize (printf "x%s" (string .size))) }}
  9. {{ else }}
  10. {{/* Constrain logo to fit within specified dimensions. */}}
  11. {{ $logo_proc = ($logo.Fit (printf "%sx%s" (string .size) (string .size))) }}
  12. {{ end }}
  13. {{ return $logo_proc }}