2
1
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2023-12-13 21:00:40 +01:00

RSS Feed Autodetection

closes #599

- {{ghost_head}} now outputs feed link tag
This commit is contained in:
Hannah Wolfe 2013-09-02 21:04:33 +01:00
parent 40c3b7fe31
commit 599d233be9
2 changed files with 3 additions and 2 deletions

View file

@ -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());
});
});

View file

@ -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/">');
});
});