diff --git a/build/production/__snapshots__/write-categories.test.js.snap b/build/production/__snapshots__/write-categories.test.js.snap index 8d16ecf..b997b1d 100644 --- a/build/production/__snapshots__/write-categories.test.js.snap +++ b/build/production/__snapshots__/write-categories.test.js.snap @@ -7,9 +7,9 @@ meta: - property: \\"og:title\\" content: macOS defaults > Category - name: \\"description\\" - content: \\"This is a description of the category. It can contain \\\\\\"quotes\\\\\\" and markdown.\\\\n\\\\n- a list item\\" + content: \\"This is a description of the category. It can contain "quotes" and markdown.\\\\n\\\\n- a list item\\" - property: \\"og:description\\" - content: \\"This is a description of the category. It can contain \\\\\\"quotes\\\\\\" and markdown.\\\\n\\\\n- a list item\\" + content: \\"This is a description of the category. It can contain "quotes" and markdown.\\\\n\\\\n- a list item\\" - property: \\"twitter:card\\" content: \\"summary\\" - property: \\"twitter:image\\" diff --git a/build/production/__snapshots__/write-pages.test.js.snap b/build/production/__snapshots__/write-pages.test.js.snap index aa2ef32..ac47bca 100644 --- a/build/production/__snapshots__/write-pages.test.js.snap +++ b/build/production/__snapshots__/write-pages.test.js.snap @@ -290,9 +290,9 @@ meta: - property: \\"og:title\\" content: macOS defaults > Category > Page - name: \\"description\\" - content: \\"This is a description of the page. It can contain \\\\\\"quotes\\\\\\" and markdown.\\\\n\\\\n- a list item\\" + content: \\"This is a description of the page. It can contain "quotes" and markdown.\\\\n\\\\n- a list item\\" - property: \\"og:description\\" - content: \\"This is a description of the page. It can contain \\\\\\"quotes\\\\\\" and markdown.\\\\n\\\\n- a list item\\" + content: \\"This is a description of the page. It can contain "quotes" and markdown.\\\\n\\\\n- a list item\\" - property: \\"twitter:card\\" content: \\"summary\\" - property: \\"twitter:image\\" diff --git a/build/production/handlebars-helpers.js b/build/production/handlebars-helpers.js index 84ecb4f..59da5ff 100644 --- a/build/production/handlebars-helpers.js +++ b/build/production/handlebars-helpers.js @@ -1,5 +1,5 @@ const Handlebars = require('handlebars') -Handlebars.registerHelper('json', (string) => { - return JSON.stringify(string) +Handlebars.registerHelper('metaTag', (string) => { + return JSON.stringify(string.replace(/"/g, '"')) }) diff --git a/build/production/templates/category.md.handlebars b/build/production/templates/category.md.handlebars index cee8a8b..ff7135b 100644 --- a/build/production/templates/category.md.handlebars +++ b/build/production/templates/category.md.handlebars @@ -4,9 +4,9 @@ meta: - property: "og:title" content: macOS defaults > {{{ name }}} - name: "description" - content: {{{ json description }}} + content: {{{ metaTag description }}} - property: "og:description" - content: {{{ json description }}} + content: {{{ metaTag description }}} - property: "twitter:card" content: "summary" - property: "twitter:image" diff --git a/build/production/templates/fr/category.md.handlebars b/build/production/templates/fr/category.md.handlebars index a31911d..b1a1c8d 100644 --- a/build/production/templates/fr/category.md.handlebars +++ b/build/production/templates/fr/category.md.handlebars @@ -4,9 +4,9 @@ meta: - property: "og:title" content: macOS defaults > {{{ name }}} - name: "description" - content: {{{ json description }}} + content: {{{ metaTag description }}} - property: "og:description" - content: {{{ json description }}} + content: {{{ metaTag description }}} - property: "twitter:card" content: "summary" - property: "twitter:image" diff --git a/build/production/templates/fr/page.md.handlebars b/build/production/templates/fr/page.md.handlebars index d90d245..fc54cff 100644 --- a/build/production/templates/fr/page.md.handlebars +++ b/build/production/templates/fr/page.md.handlebars @@ -4,9 +4,9 @@ meta: - property: "og:title" content: macOS defaults > {{{ name }}} > {{{ title }}} - name: "description" - content: {{{ json description }}} + content: {{{ metaTag description }}} - property: "og:description" - content: {{{ json description }}} + content: {{{ metaTag description }}} - property: "twitter:card" content: "summary" - property: "twitter:image" diff --git a/build/production/templates/page.md.handlebars b/build/production/templates/page.md.handlebars index b10d69f..f27e8be 100644 --- a/build/production/templates/page.md.handlebars +++ b/build/production/templates/page.md.handlebars @@ -4,9 +4,9 @@ meta: - property: "og:title" content: macOS defaults > {{{ name }}} > {{{ title }}} - name: "description" - content: {{{ json description }}} + content: {{{ metaTag description }}} - property: "og:description" - content: {{{ json description }}} + content: {{{ metaTag description }}} - property: "twitter:card" content: "summary" - property: "twitter:image"