How to use atom feed and sorted articles

83 views
Skip to first unread message

Jeet Albert

unread,
Mar 11, 2012, 9:41:04 PM3/11/12
to nanoc
Hello,

I am a little bit confused here. How can should i be using the atom
feed.Because right now i am getting error - Cannot build Atom feed:
no title in params, item or site config . I have excerpt, title and
created at in my item file. I would now like to have all the three in
the feed too.

Also how do i used sorted articles, to show upto 5 recents posts?

Thanks

Denis Defreyne

unread,
Mar 12, 2012, 2:08:12 AM3/12/12
to na...@googlegroups.com
Hi,

The feed item itself will need a title attribute as well. The documentation for the blogging helper’s atom_feed function at [1] has a fairly verbose explanation of what details are needed to set up a feed.

In order to get the 5 most recent sorted articles, you can use Array#[], e.g. sorted_articles[0..4]. Depending on the Ruby version you’re on, you can also use sorted_articles.first(5).

Cheers,

Denis

[1]: http://nanoc.stoneship.org/docs/api/3.3/Nanoc/Helpers/Blogging.html#atom_feed-instance_method

> --
> You received this message because you are subscribed to the nanoc discusssion group.
>
> To post to this group, send email to na...@googlegroups.com
> To unsubscribe from this group, send email to
> nanoc+un...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nanoc?hl=en

signature.asc
Reply all
Reply to author
Forward
0 new messages