Files
HugoBlox-kit/wowchemy/layouts/partials/jsonld/article.html
T
George Cushen 439dfb3a40 feat: more intuitive settings
BREAKING CHANGES: in params.yaml:

```
appearance:
  theme_day: minimal
  theme_night: minimal
  font: minimal
  font_size: L

seo:
  site_type: Person
  local_business_type: ''
  org_name: ''
  description: ''
  twitter: ''

header:
  navbar:
    enable: false

footer:
  text:
  copyright:
    notice: '© {year} Me. This work is licensed under {license}'
    license:
      enable: true
      allow_derivatives: false
      share_alike: true
      allow_commercial: false

features:
  privacy_pack: false
```
2022-01-13 22:01:15 +00:00

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.seo.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>