gohugoio / hugo

The world’s fastest framework for building websites.
https://gohugo.io
Apache License 2.0
73.58k stars 7.39k forks source link

Need option to use full content in rss.xml #4071

Open rayjohnson opened 6 years ago

rayjohnson commented 6 years ago

The default rss.xml template uses .Summary for the content of each item. If you want to use the full content instead you have to override the entire template. It would be nice to have an option one can set int he config.toml to control if .Summary or .Content is used.

paskal commented 6 years ago

Seems like adding whole content to summary does the trick, however it's a shame I have to make post summary-less to have it added to RSS properly (with full content). Here is the line which misbehave.

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help. If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open. If this is a feature request, and you feel that it is still relevant and valuable, please tell us why. This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

danielcompton commented 6 years ago

https://github.com/gohugoio/hugo/issues/4242 is an issue proposing a solution to this.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help. If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open. If this is a feature request, and you feel that it is still relevant and valuable, please tell us why. This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

matrixik commented 5 years ago

Stale bot, please, don't close this issue.

jakewies commented 5 years ago

Be gone Stale bot! Be gone!

bigblind commented 5 years ago

+1 for implementing this.

Kaligule commented 2 years ago

I would like to advocate an option to set the RSS-feeds to full-text.

Hugo users want this

A quick websearch for "hugo full text rss" finds up a lot of blogposts of hugo users who manually adjusted their RSS templates. These are all from the first page of results:

I think that this shows, that full-text rss is a feature that many hugo users want.

Other static-site-generators have it.

@obar pointed out that this feature is already present in many other static site generators like:

The hacky solution is insufficient

@nekr0z pointed out that just swapping out Summary and Content could result in "non-conformant" RSS feeds.

tohn commented 3 months ago

I think with the recent introduction of transform.XMLEscape the PR #10589 could finally be merged (but of course adjusted slightly with .Content | transform.XMLEscape | safeHTML instead) 🙏

jmooring commented 2 months ago

I think there's consensus that a global (site config) setting would be useful, but then I can't control it on a page-by-page basis.

Simply stuffing the full content into description may not be right approach either: https://www.rssboard.org/rss-profile#namespace-elements-content-encoded.

Publishers who don't want to employ item summaries in their feeds SHOULD use the description element for an item's full content rather than content:encoded because it has the widest support.

Publishers who employ summaries SHOULD store the summary in description and the full content in content:encoded, ordering description first within the item. On items with no summary, the full content SHOULD be stored in description.

It seems like the right way to do this is to specify both description and content:encoded (when full content option is enabled), but the "has the widest support" condition is troubling.

Given the above, I am inclined to leave the embedded template as-is. Overriding an embedded template is trivial.