diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml index b5926fd2..d7ea6025 100644 --- a/exampleSite/config/_default/params.toml +++ b/exampleSite/config/_default/params.toml @@ -46,10 +46,6 @@ org_name = "" # Description for social sharing and search engines. If undefined, superuser role is used in place. description = "" -# Display a logo in navigation bar rather than title (optional). -# To enable, place an image in `static/img/` and reference its filename below. To disable, set the value to "". -logo = "" - ############################ ## Site Features ############################ diff --git a/layouts/partials/functions/get_logo.html b/layouts/partials/functions/get_logo.html new file mode 100644 index 00000000..4bf6b8e6 --- /dev/null +++ b/layouts/partials/functions/get_logo.html @@ -0,0 +1,16 @@ +{{/* Function to get logo image. */}} +{{/* Inputs: constraint: max_height/fit (str); size (int) */}} +{{/* Output: resource (obj) */}} + +{{ $logo := resources.Get "images/logo.png" }} +{{ $logo_proc := $logo }} + +{{ if eq .constraint "max_height" }} + {{/* Resize logo to fit specified max height. */}} + {{ $logo_proc = ($logo.Resize (printf "x%s" (string .size))) }} +{{ else }} + {{/* Constrain logo to fit within specified dimensions. */}} + {{ $logo_proc = ($logo.Fit (printf "%sx%s" (string .size) (string .size))) }} +{{ end }} + +{{ return $logo_proc }} diff --git a/layouts/partials/navbar.html b/layouts/partials/navbar.html index e4977fe4..ec566f11 100644 --- a/layouts/partials/navbar.html +++ b/layouts/partials/navbar.html @@ -4,10 +4,12 @@