Ghost/core/server/data/xml/sitemap/utils.js
Hannah Wolfe 2700bfa4cc Refactor URL builder
refs #1833

- Refactor url generation to use a base urlJoin method
- urlJoin handles slash de-duping and subdir de-duping
- fixes sitemap xml option
2015-06-02 21:50:17 +01:00

14 lines
379 B
JavaScript

var config = require('../../../config'),
utils;
utils = {
getDeclarations: function () {
var baseUrl = config.urlFor('sitemap_xsl', true);
baseUrl = baseUrl.replace(/^(http:|https:)/, '');
return '<?xml version="1.0" encoding="UTF-8"?>' +
'<?xml-stylesheet type="text/xsl" href="' + baseUrl + '"?>';
}
};
module.exports = utils;