mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-06 14:14:04 +00:00
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
48 lines
1.2 KiB
HTML
48 lines
1.2 KiB
HTML
{{- $page := .page }}
|
|
{{ $summary := .summary }}
|
|
{{ $featured_image := ($page.Resources.ByType "image").GetMatch "*featured*" }}
|
|
|
|
{{/* Get schema type. */}}
|
|
{{ $schema := "Article" }}
|
|
{{ if eq $page.Type "post" }}
|
|
{{ $schema = "BlogPosting" }}
|
|
{{ end }}
|
|
|
|
{{ $author := partial "functions/get_author_name" $page }}
|
|
{{ $publisher := site.Params.org_name | default site.Title }}
|
|
{{ $logo_url := partial "functions/get_logo_url" $page -}}
|
|
|
|
<script type="application/ld+json">
|
|
{
|
|
"@context": "https://schema.org",
|
|
"@type": {{$schema}},
|
|
"mainEntityOfPage": {
|
|
"@type": "WebPage",
|
|
"@id": {{$page.Permalink}}
|
|
},
|
|
"headline": {{$page.Title}},
|
|
{{ if $featured_image }}
|
|
"image": [
|
|
{{$featured_image.Permalink}}
|
|
],
|
|
{{end}}
|
|
"datePublished": {{ $page.PublishDate.Format "2006-01-02T15:04:05Z07:00" }},
|
|
"dateModified": {{ $page.Lastmod.Format "2006-01-02T15:04:05Z07:00" }},
|
|
{{with $author}}
|
|
"author": {
|
|
"@type": "Person",
|
|
"name": {{.}}
|
|
},
|
|
{{end}}
|
|
"publisher": {
|
|
"@type": "Organization",
|
|
"name": {{$publisher}},
|
|
"logo": {
|
|
"@type": "ImageObject",
|
|
"url": {{$logo_url}}
|
|
}
|
|
},
|
|
"description": {{$summary}}
|
|
}
|
|
</script>
|