Files
HugoBlox-kit/layouts/partials/functions/get_logo_url.html
T
George Cushen c5b26892a9 feat: add support for SVG logo format + fix logo URL in JSONLD
Can now upload an SVG logo to `assets/images/logo.svg`.

If your site is for an organization, Google currently requires that the logo is PNG rather than SVG otherwise the site may not receive rich search results based on the JSONLD (see https://developers.google.com/search/docs/data-types/logo).

Also, this commit fixes the logo URL in the site's JSONLD metadata - irrespective of the above feature, the logo URL metadata broke when adding the new automated logo detection system in #1439.

Close #1512
Fix #1516
Fix #1439
2020-02-09 00:53:02 +00:00

13 lines
422 B
HTML

{{/* Function to get logo URL for JSONLD. */}}
{{/* Inputs: page context */}}
{{/* Output: logo URL (URL) */}}
{{ $logo_url := "" }}
{{ if resources.Get "images/logo.png" | or (resources.Get "images/logo.svg") }}
{{ $logo_url = (partial "functions/get_logo" (dict "constraint" "fit" "size" 192)).Permalink }}
{{ else }}
{{ $logo_url = (partial "functions/get_icon" 192).Permalink }}
{{ end }}
{{ return $logo_url }}