nielsenramon / chalk

Chalk is a high quality, completely customizable, performant and 100% free Jekyll blog theme.
http://chalk.nielsenramon.com
MIT License
1.23k stars 442 forks source link

Can't RSS subscribe to whole page content #141

Closed artis3n closed 6 years ago

artis3n commented 6 years ago

I would like to cross-post articles on my site using the Chalk theme as well as popular blog platforms. This is supported by RSS subscriptions that contain the entire article content in <content:encoded>stuff</content:encoded> sections per <item>.

Given the Jinja templating, I imagine that {{ content }} variable in _layouts/post.html is what we want in the content:encoded sections, but I haven't been able to isolate that value for each post yet. Am I being dumb, or is this not supported given the templating setup right now? Can we get it supported?

artis3n commented 6 years ago

I've currently tried <content:encoded>{{ post.content | xml_escape }}</content:encoded> and the same without xml_escape. Both break the RSS feed.

<content type="html"><![CDATA[ {{ post.content | markdownify }} ]]></content> doesn't break the RSS feed as the page will load, but also does not include the post content, so looks like it doesn't work.

nielsenramon commented 6 years ago

@arikalfus What is the error you are getting? Code looks indeed fine.

artis3n commented 6 years ago

I added the content line to rss.xml: image

And get this RSS page: image

The syntax works so the RSS page loads and displays the post title and description, but I don't get any of the actual content.

nielsenramon commented 6 years ago

@arikalfus I'm not sure that content type is supported? I would change the description to the content one if you'd like.

artis3n commented 6 years ago

I've tried removing the type attribute from content. This is definitely a Jekyll syntax thing and not specific to Chalk, but it would be nice if this could be included. We should be able to have the excerpt in the description and the full content in content...

Alternatively, I can give up and just have the description be the full article content. @nielsenramon, this can be configured with a _config.yml option, set to the original post.description by default. But if the config option is enabled, can set the full article content instead. What do you think?

artis3n commented 6 years ago

Yeah, the content field is not supported in RSS 2.0. I was basing that on Medium's RSS feeds, which do use that field. Let me know if you'd like me to submit a PR with the Jinja logic for the description described above

nielsenramon commented 6 years ago

@arikalfus No need, I think we'll keep the description in there for now. I feel it's more common. Thanks for the insights!