Skip to content

Commit

Permalink
Remove unneccessary refs to type attr in helper output snippets.
Browse files Browse the repository at this point in the history
See Issue hexojs#1695: hexojs#1695

Also see the HTML5 Spec section on the type attr:

http://dev.w3.org/html5/spec-preview/Overview.html#attr-link-type

In short, the use of type tags is purely advisory, and the
spec instructs browsers to infer the resource type before fetching
them. In cases where the inference does not match the declaration,
the resource will not be loaded. When the declaration is left off,
the resource will load. It appears generally safer to leave the tags
off entirely.
  • Loading branch information
Bryce Johnson committed Jan 9, 2016
1 parent c80de2d commit 2fdb9c8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/plugins/helper/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function cssHelper() {
result += cssHelper.apply(this, path);
} else {
if (path.substring(path.length - 4, path.length) !== '.css') path += '.css';
result += '<link rel="stylesheet" href="' + this.url_for(path) + '" type="text/css">';
result += '<link rel="stylesheet" href="' + this.url_for(path) + '">';
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/plugins/helper/feed_tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function feedTagHelper(path, options) {
var title = options.title || this.config.title;
var type = options.type || 'atom';

return '<link rel="alternate" href="' + this.url_for(path) + '" title="' + title + '" type="application/' + type + '+xml">';
return '<link rel="alternate" href="' + this.url_for(path) + '" title="' + title + '">';
}

module.exports = feedTagHelper;
2 changes: 1 addition & 1 deletion lib/plugins/helper/js.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function jsHelper() {
result += jsHelper.apply(this, path);
} else {
if (path.substring(path.length - 3, path.length) !== '.js') path += '.js';
result += '<script src="' + this.url_for(path) + '" type="text/javascript"></script>';
result += '<script src="' + this.url_for(path) + '"></script>';
}
}

Expand Down

1 comment on commit 2fdb9c8

@Xuanwo
Copy link

@Xuanwo Xuanwo commented on 2fdb9c8 Jan 11, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you are ready, welcome to pull your request~, and do not forget to rebase your code.

Please sign in to comment.