From cbcda2faf8ed86e18f2b97f59e9d32af62408f4b Mon Sep 17 00:00:00 2001 From: cobbspur Date: Wed, 17 Dec 2014 14:55:27 +0000 Subject: [PATCH] Provide absolute blog url in sitemap No issue - Adds {{blog-url}} to sitemap.xsl - Replaces all occurences of {{blog-url}} with absolute bkog url --- core/server/middleware/index.js | 5 +++-- core/shared/sitemap.xsl | 18 ++---------------- 2 files changed, 5 insertions(+), 18 deletions(-) diff --git a/core/server/middleware/index.js b/core/server/middleware/index.js index ca9f3420fb..196df13981 100644 --- a/core/server/middleware/index.js +++ b/core/server/middleware/index.js @@ -203,7 +203,8 @@ function checkSSL(req, res, next) { // Handles requests to robots.txt and favicon.ico (and caches them) function serveSharedFile(file, type, maxAge) { var content, - filePath = path.join(config.paths.corePath, 'shared', file); + filePath = path.join(config.paths.corePath, 'shared', file), + re = /(\{\{blog-url\}\})/g; return function serveSharedFile(req, res, next) { if (req.url === '/' + file) { @@ -216,7 +217,7 @@ function serveSharedFile(file, type, maxAge) { return next(err); } if (type === 'text/xsl' || type === 'text/plain') { - buf = buf.toString().replace('{{blog-url}}', config.url.replace(/\/$/, '')); + buf = buf.toString().replace(re, config.url.replace(/\/$/, '')); } content = { headers: { diff --git a/core/shared/sitemap.xsl b/core/shared/sitemap.xsl index 5344f7b0e2..778ba5e388 100644 --- a/core/shared/sitemap.xsl +++ b/core/shared/sitemap.xsl @@ -95,7 +95,7 @@ -

← Back to index

+

← Back to index

@@ -135,23 +135,9 @@
-

← Back to index

+

← Back to index

-