From 55677da695b3daf7f434c03bc9bcc3fe6d34ee5b Mon Sep 17 00:00:00 2001 From: James Panther <4462786+jpanther@users.noreply.github.com> Date: Fri, 7 Jan 2022 14:50:15 +1100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20JSON-LD=20keywords=20delim?= =?UTF-8?q?iter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #74 --- CHANGELOG.md | 1 + layouts/partials/schema.html | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 32aed3f0..0c7c2542 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Fixed - `lead` shortcode not rendering Markdown formatted text ([#73](https://github.com/jpanther/congo/issues/73)) +- JSON-LD keywords data not structured correctly ([#74](https://github.com/jpanther/congo/issues/74)) ## [1.6.1] - 2021-12-31 diff --git a/layouts/partials/schema.html b/layouts/partials/schema.html index 1cab618a..6cf9c774 100644 --- a/layouts/partials/schema.html +++ b/layouts/partials/schema.html @@ -17,7 +17,7 @@ "articleSection": "{{ (site.GetPage .Section).Title }}", "name": "{{ .Title | safeJS }}", "headline": "{{ .Title | safeJS }}", - "description": "{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}", + "description": "{{ with .Description }}{{ . }}{{ else }}{{ if .IsPage }}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}", {{ with .Site.LanguageCode }}"inLanguage": {{ . }},{{ end }} "author" : { "@type": "Person", @@ -33,8 +33,8 @@ {{ with .PublishDate }}"datePublished": "{{ .Format $iso8601 }}",{{ end }} {{ with .Lastmod }}"dateModified": "{{ .Format $iso8601 }}",{{ end }} "url" : "{{ .Permalink }}", - "wordCount": "{{ .WordCount }}", - "keywords": [{{ if .IsPage}}{{ range $index, $tag := .Params.tags }}{{ $tag }},{{ end }}{{ else }}{{ range $plural, $terms := .Site.Taxonomies }}{{ range $term, $val := $terms }}{{ printf "%s," $term }}{{ end }}{{ end }}{{ end }}] + {{ with .Params.tags }}"keywords": {{ . }},{{ end }} + "wordCount": "{{ .WordCount }}" } {{ end }}