Skip to content

Only use post content in the RSS description field. #86

Merged
merged 2 commits into from Sep 1, 2012

2 participants

@kablamo
kablamo commented Aug 26, 2012

This patch improves the RSS feed. Previously the description field was
populated with the entire web page including the header, footer, javascript,
css, etc. Now the description field is only populated with html rendered from
a post.

I tested this with Google Reader and the resulting output is much nicer.

@kablamo kablamo Only use post content in the RSS description field.
This patch improves the RSS feed.  Previously the description field was
populated with the entire web page including the header, footer, javascript,
css, etc.  Now the description field is only populated with html rendered from
a post.
9cd6df9
@plusjade plusjade commented on an outdated diff Aug 26, 2012
lib/ruhoh/page.rb
@@ -28,6 +28,11 @@ def render
@templater.render(self.expand_layouts, self.payload)
end
+ def render_rss
+ self.ensure_id
+ @templater.render(self.expand_layouts, self.payload)
@plusjade
ruhoh member
plusjade added a note Aug 26, 2012

if we want to only output the body we don't need to expand_layouts at all:

@templater.render('{{{content}}}', self.payload)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@plusjade plusjade commented on an outdated diff Aug 26, 2012
lib/ruhoh/page.rb
@@ -28,6 +28,11 @@ def render
@templater.render(self.expand_layouts, self.payload)
end
+ def render_rss
@plusjade
ruhoh member
plusjade added a note Aug 26, 2012

can we change this to a more general purpose name: render_content

@plusjade
ruhoh member
plusjade added a note Aug 27, 2012

Note my updates above. Since @page already has a @page.content method (outputs raw file content body), the render method should be named render_content

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@plusjade
ruhoh member

@kablamo I like this a lot! Very concise and useful addition. Can you consider my in-line comment suggestions and pending those updates I'll merge this right in. Thanks for your help!

@plusjade plusjade merged commit 9dd7c14 into ruhoh:master Sep 1, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.