New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise the default rssLimit? #3145

Closed
ominty opened this Issue Mar 8, 2017 · 6 comments

Comments

Projects
None yet
3 participants
@ominty
Contributor

ominty commented Mar 8, 2017

I have a page with sections of "normal web pages" - these are sorted by weight to get the appropriate page order in the menu.
Then there is a blog section which is naturally is sorted by reverse date.

I create a site wide RSS feed like the following:

<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>{{ if eq  .Title  .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
    <link>{{ .Permalink }}</link>
    <description>Custom Template - Recent content {{ if ne  .Title  .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
    <generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
    <language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
    <managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
    <webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
    <copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
    <lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
    <atom:link href="{{.Permalink}}" rel="self" type="application/rss+xml" />
    {{ range first 15 .Data.Pages.ByDate.Reverse }}
    <item>
      <title>{{ .Title }}</title>
      <link>{{ .Permalink }}</link>
      <pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
      {{ with .Site.Author.email }}<author>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</author>{{end}}
      <guid>{{ .Permalink }}</guid>
      <description>{{ .Summary | html }}</description>
    </item>
    {{ end }}
  </channel>
</rss>

but this does not show up any new articles from the blog but only the weighted pages from the other sections.

V0.19
https://github.com/ominty/ominty-hugoissues/tree/issue3145

@bep

This comment has been minimized.

Show comment
Hide comment
@bep

bep Mar 8, 2017

Member

Please use http://discuss.gohugo.io/ for questions/troubleshooting. Also see Hugo Documentation.

Member

bep commented Mar 8, 2017

Please use http://discuss.gohugo.io/ for questions/troubleshooting. Also see Hugo Documentation.

@bep bep closed this Mar 8, 2017

@ominty

This comment has been minimized.

Show comment
Hide comment
@ominty

ominty Mar 8, 2017

Contributor

We had this discussion here https://discuss.gohugo.io/t/rss-feed-sorting-by-date-broken-in-0-19/5661/2 and this is a regression as it worked in V0.18.1 without any issues. So I reverted to that version as workaround.

To give some more explanation:
There are three sections:
blog - this is sorted by date, pages only have date but not weight in frontmatter
hund, womo and kontakt - pages weight and date, so they are sorted by weight within their section.

The rss-feed is site-wide and obviously should show the blog entries by date, but also pages from the other sections if they are updated (get new current date), therefore {{ range first 15 .Data.Pages.ByDate.Reverse }}.

As I said: working properly in V0.18.1 but does only show pages by weight and ignores sorting by date completely in V0.19

Contributor

ominty commented Mar 8, 2017

We had this discussion here https://discuss.gohugo.io/t/rss-feed-sorting-by-date-broken-in-0-19/5661/2 and this is a regression as it worked in V0.18.1 without any issues. So I reverted to that version as workaround.

To give some more explanation:
There are three sections:
blog - this is sorted by date, pages only have date but not weight in frontmatter
hund, womo and kontakt - pages weight and date, so they are sorted by weight within their section.

The rss-feed is site-wide and obviously should show the blog entries by date, but also pages from the other sections if they are updated (get new current date), therefore {{ range first 15 .Data.Pages.ByDate.Reverse }}.

As I said: working properly in V0.18.1 but does only show pages by weight and ignores sorting by date completely in V0.19

@bep

This comment has been minimized.

Show comment
Hide comment
@bep

bep Mar 8, 2017

Member

See #3036

Put rssLimit = 2000000 or something in config.toml and you should be good to go.

Member

bep commented Mar 8, 2017

See #3036

Put rssLimit = 2000000 or something in config.toml and you should be good to go.

@bep bep changed the title from V0.19 ignores sorting .ByDate when pages with weight present to Raise the default rssLimit to 50 Mar 8, 2017

@bep bep changed the title from Raise the default rssLimit to 50 to Raise the default rssLimit? Mar 8, 2017

@bep bep reopened this Mar 8, 2017

@ominty

This comment has been minimized.

Show comment
Hide comment
@ominty

ominty Mar 9, 2017

Contributor

Put rssLimit = 2000000 or something in config.toml and you should be good to go.

thanks, this indeed seems to work

But - for my understanding of the matter: If I would have used something like
{{ range first 10 .Data.Pages.ByDate.Reverse }}
with 10 instead of 15 I would not have seen the issue described above?

Contributor

ominty commented Mar 9, 2017

Put rssLimit = 2000000 or something in config.toml and you should be good to go.

thanks, this indeed seems to work

But - for my understanding of the matter: If I would have used something like
{{ range first 10 .Data.Pages.ByDate.Reverse }}
with 10 instead of 15 I would not have seen the issue described above?

@moorereason

This comment has been minimized.

Show comment
Hide comment
@moorereason

moorereason Mar 10, 2017

Contributor

Two questions:

  1. I'll submit a PR to allow users to disable the limit by setting rssLimit to a negative integer.
  2. Do we want to change the default rssLimit from 15 to -1?
Contributor

moorereason commented Mar 10, 2017

Two questions:

  1. I'll submit a PR to allow users to disable the limit by setting rssLimit to a negative integer.
  2. Do we want to change the default rssLimit from 15 to -1?
@bep

This comment has been minimized.

Show comment
Hide comment
@bep

bep Mar 10, 2017

Member

Yes, I think "unlimited" would be the least surprising option for most people.

Member

bep commented Mar 10, 2017

Yes, I think "unlimited" would be the least surprising option for most people.

moorereason added a commit to moorereason/hugo that referenced this issue Mar 10, 2017

@bep bep added this to the v0.20 milestone Mar 10, 2017

@bep bep closed this in #3155 Mar 10, 2017

bep added a commit that referenced this issue Mar 10, 2017

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