Skip to content

Commit

Permalink
fix css and js helper to prevent adding .css/.js when the path alread…
Browse files Browse the repository at this point in the history
…y has parameter (hexojs#2274)
  • Loading branch information
aulphar authored and NoahDragon committed Dec 5, 2016
1 parent e4ab1be commit 30823fc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/plugins/helper/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function cssHelper() {
if (Array.isArray(path)) {
result += cssHelper.apply(this, path);
} else {
if (path.substring(path.length - 4, path.length) !== '.css') path += '.css';
if (path.indexOf('?') < 0 && path.substring(path.length - 4, path.length) !== '.css') path += '.css';
result += '<link rel="stylesheet" href="' + this.url_for(path) + '">';
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/plugins/helper/js.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function jsHelper() {
if (Array.isArray(path)) {
result += jsHelper.apply(this, path);
} else {
if (path.substring(path.length - 3, path.length) !== '.js') path += '.js';
if (path.indexOf('?') < 0 && path.substring(path.length - 3, path.length) !== '.js') path += '.js';
result += '<script src="' + this.url_for(path) + '"></script>';
}
}
Expand Down

0 comments on commit 30823fc

Please sign in to comment.