Skip to content
This repository was archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
fix(SEO): some bad escape sequence in JSON-LD part 2 (#202)
Browse files Browse the repository at this point in the history
* fix(SEO): some bad escape sequence in JSON-LD part 2

* fix(SEO): some bad escape sequence in JSON-LD Part 2

Co-authored-by: Dillon <[email protected]>
  • Loading branch information
cmpsoares91 and dillonzq authored Apr 22, 2020
1 parent d90a2d9 commit 919f559
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions layouts/partials/head/seo.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
{{- with .Site.Author.name -}}
"author": {
"@type": "Person",
"name": "{{ . | safeJS }}"
"name": {{ . | safeHTML }}
},
{{- end -}}
{{- with .Site.Params.description -}}
"description": "{{ . | safeJS }}",
"description": {{ . | safeHTML }},
{{- end -}}
{{- with $params.seo.image -}}
"image": "{{ .url | absURL }}",
Expand All @@ -42,9 +42,9 @@
"thumbnailUrl": "{{ .url | absURL }}",
{{- end -}}
{{- with .Site.Copyright -}}
"license": "{{ . | safeJS }}",
"license": "{{ . | safeHTML }}",
{{- end -}}
"name": "{{ .Site.Title | safeJS }}"
"name": {{ .Site.Title | safeHTML }}
}
</script>

Expand All @@ -54,7 +54,7 @@
{
"@context": "http://schema.org",
"@type": "BlogPosting",
"headline": "{{ .Title | safeJS }}",
"headline": {{ .Title | safeHTML }},
"inLanguage": "{{ .Site.LanguageCode }}",
"mainEntityOfPage": {
"@type": "WebPage",
Expand All @@ -75,20 +75,20 @@
"wordcount": {{ .WordCount }},
"url": "{{ .Permalink }}",
{{- if not .PublishDate.IsZero -}}
"datePublished": "{{ .PublishDate.Format "2006-01-02" }}",
"datePublished": {{ .PublishDate.Format "2006-01-02T15:04:05-07:00" | safeHTML }},
{{- else if not .Date.IsZero -}}
"datePublished": "{{ .Date.Format "2006-01-02" }}",
"datePublished": {{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }},
{{- end -}}
{{- with .Lastmod -}}
"dateModified": "{{ .Format "2006-01-02" }}",
"dateModified": {{ .Format "2006-01-02T15:04:05-07:00" | safeHTML }},
{{- end -}}
{{- with .Site.Copyright -}}
"license": "{{ . | safeJS }}",
"license": {{ . | safeHTML }},
{{- end -}}
{{- with $params.seo.publisher -}}
"publisher": {
"@type": "Organization",
"name": "{{ .name | safeJS }}",
"name": "{{ .name }}",
"logo": {
"@type": "ImageObject",
"url": "{{ .logo.url | absURL }}",
Expand All @@ -100,10 +100,10 @@
{{- with .Params.author | default .Site.Author.name | default (T "author") -}}
"author": {
"@type": "Person",
"name": "{{ . | safeJS }}"
"name": {{ . | safeHTML }}
},
{{- end -}}
"description": "{{ .Description | safeJS }}"
"description": {{ .Description | safeHTML }}
}
</script>
{{- end -}}

0 comments on commit 919f559

Please sign in to comment.