feat: strengthen operator template and localized SEO UX
This commit is contained in:
@@ -22,9 +22,14 @@
|
||||
-}}
|
||||
<script type="application/ld+json">{{ $data | jsonify | safeJS }}</script>
|
||||
|
||||
{{- else if eq $type "FAQPage" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if or .IsHome (eq $type "FAQPage") .Params.showFaqAccordion -}}
|
||||
{{- $faqKey := printf "faq.%s" .Language.Lang -}}
|
||||
{{- $faqs := index .Site.Data $faqKey -}}
|
||||
{{- if not $faqs -}}{{- $faqs = .Site.Data.faq -}}{{- end -}}
|
||||
{{- $items := slice -}}
|
||||
{{- range .Site.Data.faq -}}
|
||||
{{- range $faqs -}}
|
||||
{{- $items = $items | append (dict
|
||||
"@type" "Question"
|
||||
"name" .question
|
||||
@@ -38,9 +43,11 @@
|
||||
-}}
|
||||
<script type="application/ld+json">{{ $data | jsonify | safeJS }}</script>
|
||||
|
||||
{{- else if eq $type "Article" -}}
|
||||
{{- /* The About page is an editorial review, so we emit a Review with the
|
||||
promoted operator as the reviewed item. */ -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if and (eq $type "Article") .Params.showRatingWidget -}}
|
||||
{{- $authorName := .Params.authorName | default $brand.name -}}
|
||||
{{- $authorType := cond (isset .Params "authorName") "Person" "Organization" -}}
|
||||
{{- $data := dict
|
||||
"@context" "https://schema.org"
|
||||
"@type" "Review"
|
||||
@@ -48,10 +55,22 @@
|
||||
"url" .Permalink
|
||||
"datePublished" (.Date.Format "2006-01-02")
|
||||
"dateModified" (.Lastmod.Format "2006-01-02")
|
||||
"author" (dict "@type" $authorType "name" $authorName)
|
||||
"publisher" (dict "@type" "Organization" "name" $brand.name "logo" (dict "@type" "ImageObject" "url" ($brand.logoPath | absURL)))
|
||||
"itemReviewed" (dict "@type" "Organization" "name" $brand.name)
|
||||
"reviewRating" (dict "@type" "Rating" "ratingValue" (.Params.rating | default $brand.ratingValue) "bestRating" 5 "worstRating" 1)
|
||||
-}}
|
||||
<script type="application/ld+json">{{ $data | jsonify | safeJS }}</script>
|
||||
{{- else if eq $type "Article" -}}
|
||||
{{- $data := dict
|
||||
"@context" "https://schema.org"
|
||||
"@type" "Article"
|
||||
"headline" (.Params.h1 | default .Title)
|
||||
"url" .Permalink
|
||||
"datePublished" (.Date.Format "2006-01-02")
|
||||
"dateModified" (.Lastmod.Format "2006-01-02")
|
||||
"author" (dict "@type" "Organization" "name" $brand.name)
|
||||
"publisher" (dict "@type" "Organization" "name" $brand.name "logo" (dict "@type" "ImageObject" "url" ($brand.logoPath | absURL)))
|
||||
"itemReviewed" (dict "@type" "Organization" "name" $brand.legalOperatorName)
|
||||
"reviewRating" (dict "@type" "Rating" "ratingValue" $brand.ratingValue "bestRating" 5 "worstRating" 1)
|
||||
-}}
|
||||
<script type="application/ld+json">{{ $data | jsonify | safeJS }}</script>
|
||||
{{- end -}}
|
||||
|
||||
Reference in New Issue
Block a user