From 97bd8c40ea5bf445e44ce10f791a47a7f7ddf4f8 Mon Sep 17 00:00:00 2001 From: germanrcuriel Date: Sun, 3 Nov 2013 03:28:08 +0100 Subject: [PATCH] Add rel='canonical' support closes #1341 - Added canonical link to header using ghost_head helper. --- core/server/helpers/index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/server/helpers/index.js b/core/server/helpers/index.js index fb19e46679..9c2434ca9a 100644 --- a/core/server/helpers/index.js +++ b/core/server/helpers/index.js @@ -46,7 +46,7 @@ coreHelpers.date = function (context, options) { // // ### URI Encoding helper -// +// // *Usage example:* // `{{encode uri}}` // @@ -58,10 +58,10 @@ coreHelpers.encode = function (context, str) { }; // ### Page URL Helper -// +// // *Usage example:* // `{{pageUrl 2}}` -// +// // Returns the URL for the page specified in the current object // context. // @@ -297,6 +297,9 @@ coreHelpers.ghost_head = function (options) { head.push(''); head.push(''); + if (this.path) { + head.push(''); + } return coreHelpers.ghost.doFilter('ghost_head', head).then(function (head) { var headString = _.reduce(head, function (memo, item) { return memo + '\n' + item; }, '');