From 3d2f03a08f0391d8fbe0c9436c1d5dd183bf645b Mon Sep 17 00:00:00 2001 From: Jacob Gable Date: Sun, 1 Sep 2013 20:29:56 -0500 Subject: [PATCH] Fix RSS urls --- config.js | 3 +++ core/server/controllers/frontend.js | 24 ++++++++++++------------ 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/config.js b/config.js index c73733de82..24d41a8dd1 100644 --- a/config.js +++ b/config.js @@ -21,6 +21,9 @@ config.activePlugins = [ 'FancyFirstChar' ]; +// The url to use when providing links to the site; like RSS and email. +config.siteUrl = 'http://127.0.0.1'; + // ## Default Navigation Items // Add new objects here to extend the menu output by {{nav}} config.nav = [ diff --git a/core/server/controllers/frontend.js b/core/server/controllers/frontend.js index d86a4e8a59..5e7be6f8ca 100644 --- a/core/server/controllers/frontend.js +++ b/core/server/controllers/frontend.js @@ -50,17 +50,17 @@ frontendControllers = { }, 'rss': function (req, res) { // Initialize RSS - var feed = new RSS({ - title: ghost.settings().title, - description: ghost.settings().description, - generator: 'Ghost v' + ghost.settings().currentVersion, - author: ghost.settings().author, - feed_url: ghost.settings().url + '/rss/', - site_url: ghost.settings().url, - ttl: '60' - }), - - // Parse the page number + var siteUrl = ghost.config().siteUrl, + feed = new RSS({ + title: ghost.settings().title, + description: ghost.settings().description, + generator: 'Ghost v' + ghost.settings().currentVersion, + author: ghost.settings().author, + feed_url: siteUrl + '/rss/', + site_url: siteUrl, + ttl: '60' + }), + // Parse the page number pageParam = req.params.page !== undefined ? parseInt(req.params.page, 10) : 1; // No negative pages @@ -87,7 +87,7 @@ frontendControllers = { var item = { title: post.title, guid: post.uuid, - url: ghost.settings().url + '/' + post.slug + '/', + url: siteUrl + '/' + post.slug + '/', date: post.published_at };