Skip to content

Commit

Permalink
Merge 6131c81 into 9c402f7
Browse files Browse the repository at this point in the history
  • Loading branch information
kscript committed Feb 14, 2019
2 parents 9c402f7 + 6131c81 commit 2e9bea2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.exports = function(locals) {
if (feedConfig.limit) posts = posts.limit(feedConfig.limit);

var url = config.url;
if (url[url.length - 1] !== '/') url += '/';
url = url.slice(0, -1) + [url.slice(-1), '/', config.root, '/'].join('').replace(/\/+/g, '/');

var icon;
if (feedConfig.icon) icon = url + feedConfig.icon;
Expand Down
8 changes: 4 additions & 4 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,10 @@ describe('Feed generator', function() {

var GOOD = 'http://localhost/blog/';

checkURL('http://localhost/blog', '/blog/', GOOD);
checkURL('http://localhost/blog', '/blog', GOOD);
checkURL('http://localhost/blog/', '/blog/', GOOD);
checkURL('http://localhost/blog/', '/blog', GOOD);
checkURL('http://localhost', '/blog/', GOOD);
checkURL('http://localhost', '/blog', GOOD);
checkURL('http://localhost/', '/blog/', GOOD);
checkURL('http://localhost/', '/blog', GOOD);

checkURL('http://localhost/b/l/o/g', '/', 'http://localhost/b/l/o/g/');

Expand Down

0 comments on commit 2e9bea2

Please sign in to comment.