0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Set RSS link title to blog title

This commit is contained in:
Jakob Gillich 2013-11-20 15:24:40 +01:00
parent 1c5a811760
commit 0c02161db7
2 changed files with 5 additions and 4 deletions

View file

@ -291,12 +291,13 @@ coreHelpers.ghost_head = function (options) {
/*jslint unparam:true*/
var head = [],
majorMinor = /^(\d+\.)?(\d+)/,
trimmedVersion = this.version;
trimmedVersion = this.version,
blog = coreHelpers.ghost.blogGlobals();
trimmedVersion = trimmedVersion ? trimmedVersion.match(majorMinor)[0] : '?';
head.push('<meta name="generator" content="Ghost ' + trimmedVersion + '" />');
head.push('<link rel="alternate" type="application/rss+xml" title="RSS" href="/rss/">');
head.push('<link rel="alternate" type="application/rss+xml" title="' + _.escape(blog.title) + '" href="/rss/">');
if (this.path) {
head.push('<link rel="canonical" href="' + coreHelpers.ghost.config().url + this.path + '" />');
}

View file

@ -242,7 +242,7 @@ describe('Core Helpers', function () {
it('returns meta tag string', function (done) {
helpers.ghost_head.call({version: "0.3.0"}).then(function (rendered) {
should.exist(rendered);
rendered.string.should.equal('<meta name="generator" content="Ghost 0.3" />\n<link rel="alternate" type="application/rss+xml" title="RSS" href="/rss/">');
rendered.string.should.equal('<meta name="generator" content="Ghost 0.3" />\n<link rel="alternate" type="application/rss+xml" title="Ghost" href="/rss/">');
done();
});
@ -251,7 +251,7 @@ describe('Core Helpers', function () {
it('returns meta tag string even if version is invalid', function () {
var rendered = helpers.ghost_head.call({version: "0.9"}).then(function (rendered) {
should.exist(rendered);
rendered.string.should.equal('<meta name="generator" content="Ghost 0.9" />\n<link rel="alternate" type="application/rss+xml" title="RSS" href="/rss/">');
rendered.string.should.equal('<meta name="generator" content="Ghost 0.9" />\n<link rel="alternate" type="application/rss+xml" title="Ghost" href="/rss/">');
});
});
});