Does Feed work with Learn2?

Hello,

I added links to each page (doc).

<a class=“button” href="{{ base_url }}.atom"><i class=“fa fa-rss-square”></i> Atom 1.0</a>
<a class=“button” href="{{ base_url }}.rss"><i class=“fa fa-rss-square”></i> RSS</a>

It shows buttons (1).Looks like working (2). But can’t add to Feedly (3).

The feed “works”, but this is not the way to generate it: the feed needs to be generated form a collection page. Like a blog posts list, for example.

I assume you’ve based your site on the RTFM skeleton. In this case, there are no collections defined in the pages: it’s all based on pages being children of other pages.

If you want your feed to show all the pages you add to the site, create a hidden page (visible: false), define a collection on it, and generate the feed.

For example:

/users/pages/new/default.md

---
visible: false
content:
    items: 
        '@taxonomy.category': 'docs'
    order:
        by: date
        dir: desc
---

and point the feed links to yoursite.com/new.rss / yoursite.com/new.atom

2 Likes

Thank you for your answer. So I made a collection feed but I can’t link it. I can’t code. These links are not working.

I think you need to change that href location to the new page that defines the collection like @flavio mentioned:

<a class="button" href="{{ base_url }}/new.atom"><i class="fa fa-rss-square"></i> Atom 1.0</a>
<a class="button" href="{{ base_url }}/new.rss"><i class="fa fa-rss-square"></i> RSS</a>

Oh, okay. I also changed headers in base.html.twig:



It’s working perfectly with Feedly. Thank you very much.

This is a super-helpful thread👍 Based on this info I’ve been able to add an option for RSS support with my Learn2 with Git Sync theme (a customized version of the Learn2 theme). Thanks everyone!

ps - you can get a sneak peek at http://learn.hibbittsdesign.org/
(bottom of sidebar)

1 Like