mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 19:33:02 +03:00
RSS Feed Autodetection
closes #599 - {{ghost_head}} now outputs feed link tag
This commit is contained in:
parent
40c3b7fe31
commit
599d233be9
@ -166,9 +166,10 @@ coreHelpers = function (ghost) {
|
||||
ghost.registerThemeHelper('ghost_head', function (options) {
|
||||
var head = [];
|
||||
head.push('<meta name="generator" content="Ghost ' + this.version + '" />');
|
||||
head.push('<link rel="alternate" type="application/rss+xml" title="RSS" href="/rss/">');
|
||||
|
||||
return ghost.doFilter('ghost_head', head, function (head) {
|
||||
var headString = _.reduce(head, function (memo, item) { return memo + ' ' + item; }, '');
|
||||
var headString = _.reduce(head, function (memo, item) { return memo + "\n" + item; }, '');
|
||||
return new hbs.handlebars.SafeString(headString.trim());
|
||||
});
|
||||
});
|
||||
|
@ -188,7 +188,7 @@ describe('Core Helpers', function () {
|
||||
it('returns meta tag string', function () {
|
||||
var rendered = handlebars.helpers.ghost_head.call({version: "0.3"});
|
||||
should.exist(rendered);
|
||||
rendered.string.should.equal('<meta name="generator" content="Ghost 0.3" />');
|
||||
rendered.string.should.equal('<meta name="generator" content="Ghost 0.3" />\n<link rel="alternate" type="application/rss+xml" title="RSS" href="/rss/">');
|
||||
});
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user