Merge pull request #900 from sebgie/issue#886

This commit is contained in:
Hannah Wolfe 2013-09-26 15:39:59 +01:00
commit 4ad935e4f5
3 changed files with 21 additions and 16 deletions

View File

@ -70,11 +70,8 @@
border-bottom: none;
box-shadow: #edece4 0 -1px 0 inset, #edece4 1px 0 0;
//Transparent gradient to make bg fade out as it goes out the top.
background: -moz-linear-gradient(top, rgba(255,255,255,1) 0%, rgba(255,255,255,1) 25%, rgba(255,255,255,0.90) 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,1)), color-stop(25%,rgba(255,255,255,1)), color-stop(100%,rgba(255,255,255,0.90)));
background: -webkit-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(255,255,255,1) 25%,rgba(255,255,255,0.90) 100%);
background: -o-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(255,255,255,1) 25%,rgba(255,255,255,0.90) 100%);
background: -ms-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(255,255,255,1) 25%,rgba(255,255,255,0.90) 100%);
background: linear-gradient(to bottom, rgba(255,255,255,1) 0%,rgba(255,255,255,1) 25%,rgba(255,255,255,0.90) 100%);
@include breakpoint($netbook) {

View File

@ -1178,11 +1178,8 @@ main {
font-size: 0.85em;
color: $brown;
//Transparent gradient to make bg fade out as it goes out the top.
background: -moz-linear-gradient(top, rgba(255,255,255,1) 0%, rgba(255,255,255,1) 25%, rgba(255,255,255,0.90) 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,1)), color-stop(25%,rgba(255,255,255,1)), color-stop(100%,rgba(255,255,255,0.90)));
background: -webkit-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(255,255,255,1) 25%,rgba(255,255,255,0.90) 100%);
background: -o-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(255,255,255,1) 25%,rgba(255,255,255,0.90) 100%);
background: -ms-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(255,255,255,1) 25%,rgba(255,255,255,0.90) 100%);
background: linear-gradient(to bottom, rgba(255,255,255,1) 0%,rgba(255,255,255,1) 25%,rgba(255,255,255,0.90) 100%);
button, .button {

View File

@ -10,6 +10,8 @@ var Ghost = require('../../ghost'),
_ = require('underscore'),
errors = require('../errorHandling'),
when = require('when'),
url = require('url'),
ghost = new Ghost(),
frontendControllers;
@ -87,7 +89,7 @@ frontendControllers = {
description: ghost.settings('description'),
generator: 'Ghost v' + res.locals.version,
author: user ? user.attributes.name : null,
feed_url: siteUrl + '/rss/',
feed_url: url.resolve(siteUrl, '/rss/'),
site_url: siteUrl,
ttl: '60'
});
@ -118,16 +120,24 @@ frontendControllers = {
ghost.doFilter('prePostsRender', page.posts, function (posts) {
posts.forEach(function (post) {
var item = {
title: _.escape(post.title),
guid: post.uuid,
url: siteUrl + '/' + post.slug + '/',
date: post.published_at
};
if (post.meta_description !== null) {
item.push({ description: post.meta_description });
}
title: _.escape(post.title),
guid: post.uuid,
url: siteUrl + '/' + post.slug + '/',
date: post.published_at,
},
content = post.html;
//set img src to absolute url
content = content.replace(/src=["|'|\s]?([\w\/\?\$\.\+\-;%:@&=,_]+)["|'|\s]?/gi, function (match, p1) {
p1 = url.resolve(siteUrl, p1);
return "src='" + p1 + "' ";
});
//set a href to absolute url
content = content.replace(/href=["|'|\s]?([\w\/\?\$\.\+\-;%:@&=,_]+)["|'|\s]?/gi, function (match, p1) {
p1 = url.resolve(siteUrl, p1);
return "href='" + p1 + "' ";
});
item.description = content;
feed.item(item);
});
res.set('Content-Type', 'text/xml');
@ -138,6 +148,7 @@ frontendControllers = {
return next(new Error(err));
});
}
};
module.exports = frontendControllers;