diff --git a/include/schema/common/head.json b/include/schema/common/head.json index 3269314..3e62d22 100644 --- a/include/schema/common/head.json +++ b/include/schema/common/head.json @@ -10,11 +10,6 @@ "default": "/img/favicon.svg", "nullable": true }, - "canonical_url": { - "type": "string", - "description": "Canonical URL of the current page", - "nullable": true - }, "open_graph": { "$ref": "/misc/open_graph.json" }, diff --git a/layout/common/article.jsx b/layout/common/article.jsx index 51a3ed4..783a159 100644 --- a/layout/common/article.jsx +++ b/layout/common/article.jsx @@ -8,6 +8,9 @@ const Comment = require('./comment'); * Get the word count of text. */ function getWordCount(content) { + if (typeof content === 'undefined') { + return 0; + } content = content.replace(/<\/?[a-z][^>]*>/gi, ''); content = content.trim(); return content ? (content.match(/[\u00ff-\uffff]|[a-zA-Z]+/g) || []).length : 0;