├── .github
└── FUNDING.yml
├── LICENSE.md
├── README.md
├── feed.articles.xml
├── feed.category.xml
├── feed.links.xml
└── feed.xml
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: georgemandis
4 | patreon:
5 | open_collective: # Replace with a single Open Collective username
6 | ko_fi: # Replace with a single Ko-fi username
7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | liberapay: # Replace with a single Liberapay username
10 | issuehunt: # Replace with a single IssueHunt username
11 | otechie: # Replace with a single Otechie username
12 | custom:
13 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2014 George Mandis
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Jekyll RSS Feed Templates
2 | =========================
3 |
4 | **NOTE:** If you're a fan of this project you should checkout the sister project: [jekyll-json-feeds](https://github.com/snaptortoise/jekyll-json-feeds).
5 |
6 | A few Liquid templates to use for rendering RSS feeds for your Jekyll blog. Featuring four kinds of feeds:
7 |
8 | - **feed.xml** — Renders the 10 most recent posts.
9 | - **feed.category.xml** — Only renders posts for a specific category. This example renders posts for a "miscellaneous" category.
10 | - **feed.links.xml** — Only contains posts that link to external websites noted by a link variable in the [YAML Front Matter](https://github.com/mojombo/jekyll/wiki/YAML-Front-Matter). Not a common Jekyll convention, but a good way to generating a linked list.
11 | - **feed.articles.xml** — Only showing articles that don't link to external sites; The opposite of feed.links.xml
12 |
13 | How to use
14 | ----------
15 | - Update \_config.yml as noted below, or manually replace the variables.
16 | - Copy one of the xml (ie, feed.xml) files to the root directory of your Jekyll blog.
17 | - Run jekyll.
18 |
19 | In your generated \_site folder you should find a properly formatted feed at feed.xml.
20 |
21 | Customizing \_config.yml
22 | ------
23 | These templates rely on a customized version of \_config.yml. The following lines have been added:
24 |
25 | name: Your Blog's Name
26 | description: A description for your blog
27 | url: http://your-blog-url.example.com
28 | feed_items: 10
29 | feed_update_period: daily
30 | feed_update_frequency: 1
31 |
32 | This makes it easy to reference the title, description and URL for your site in the feed templates using {{ site.name }}, {{ site.description }} and {{ site.url }}. Even if you're not using these feed templates, you might find these variables useful when you're designing your layouts.
33 |
34 | The `feed_*` items shown above are the default. You can safely omit them.
35 |
36 | Miscellany
37 | -----------
38 | - **Note on YAML Front Matter block**: The xml files contain an empty [YAML Front Matter](https://github.com/mojombo/jekyll/wiki/YAML-Front-Matter) block. This is necessary because Jekyll will not process a page with Liquid unless there is a YAML block at the top of the file.
39 |
40 | - **Note on layouts**: Previously, this block contained the line layout: none but that was found to cause a separate issue for some: https://github.com/snaptortoise/jekyll-rss-feeds/commit/209b83b504fde14722491ea5d9753189566c8598. However, if you've specified a *default* layout in your `_config.yml` file then you **will** most likely want to specify `layout: none` for your RSS feeds. Otherwise they will render in the default layout which is likely to be an HTML page. See this issue for reference: [https://github.com/snaptortoise/jekyll-rss-feeds/issues/32](https://github.com/snaptortoise/jekyll-rss-feeds/issues/32)
41 |
42 | - **RSS Autodiscovery**: If your template is not already setup to do so, make sure the RSS feeds are discoverable by browsers, bots, etc. by providing proper link tags to your Jekyll layout files (adapt `href` and `title` appropriately):
43 |
44 |
45 |
46 | Refer to [rssboard.org/rss-autodiscovery](http://www.rssboard.org/rss-autodiscovery) for details.
47 | - **Validation**: You can use the W3C Validator to make sure your feeds are formatted correctly: [http://validator.w3.org/feed/](http://validator.w3.org/feed/)
48 |
49 | - If you're a [Pinboard](https://pinboard.in) user and found this repo useful, take a look at [jekyll-pinboard](https://github.com/snaptortoise/jekyll-pinboard-plugin). It allows you to load your Pinboard bookmarks into your Jekyll site with just a couple lines.
50 |
51 | - If you're looking for [JSON feed](jsonfeed.org) templates to add to your Jekyll blog please checkout the sister project: [jekyll-json-feeds](https://github.com/snaptortoise/jekyll-json-feeds).
52 |
--------------------------------------------------------------------------------
/feed.articles.xml:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 |
4 |
8 |
9 | {{ site.name | xml_escape }} - Articles
10 | {% if site.description %}{{ site.description | xml_escape }}{% endif %}
11 | {{ site.feed_update_period | default: "daily" | xml_escape }}
12 | {{ site.feed_update_frequency | default: 1 | xml_escape }}
13 | {{ site.url }}
14 |
15 | {% for post in site.posts limit:1 %}{% unless post.link %}{{ post.date | date_to_rfc822 }}{% endunless %}{% endfor %}
16 | {% for post in site.posts %}
17 | {% unless post.link %}
18 |
19 | {{ post.title | xml_escape }}
20 | {% if post.excerpt %}
21 | {{ post.excerpt | xml_escape }}
22 | {% else %}
23 | {{ post.content | xml_escape }}
24 | {% endif %}
25 | {{ post.date | date_to_rfc822 }}
26 | {{ site.url }}{{ post.url }}
27 | {{ site.url }}{{ post.url }}
28 |
29 | {% endunless %}
30 | {% endfor %}
31 |
32 |
33 |
--------------------------------------------------------------------------------
/feed.category.xml:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 |
4 |
8 |
9 | {{ site.name | xml_escape }} - Miscellaneous
10 | Posts categorized as 'miscellaneous'
11 | {{ site.feed_update_period | default: "daily" | xml_escape }}
12 | {{ site.feed_update_frequency | default: 1 | xml_escape }}
13 | {{ site.url }}
14 |
15 | {% for post in site.categories.miscellaneous limit:1 %}{{ post.date | date_to_rfc822 }}{% endfor %}
16 | {% assign feed_items = site.feed_items | default: 10 %}
17 | {% for post in site.categories.miscellaneous limit:feed_items %}
18 |
19 | {{ post.title | xml_escape }}
20 | {% if post.excerpt %}
21 | {{ post.excerpt | xml_escape }}
22 | {% else %}
23 | {{ post.content | xml_escape }}
24 | {% endif %}
25 | {{ post.date | date_to_rfc822 }}
26 | {{ site.url }}{{ post.url }}
27 | {{ site.url }}{{ post.url }}
28 |
29 | {% endfor %}
30 |
31 |
32 |
--------------------------------------------------------------------------------
/feed.links.xml:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 |
4 |
8 |
9 | {{ site.name | xml_escape }} - Links
10 | {% if site.description %}{{ site.description | xml_escape }}{% endif %}
11 | {{ site.feed_update_period | default: "daily" | xml_escape }}
12 | {{ site.feed_update_frequency | default: 1 | xml_escape }}
13 | {{ site.url }}
14 |
15 | {% for post in site.posts limit:1 %}{% if post.link %}{{ post.date | date_to_rfc822 }}{% ifunless %}{% endfor %}
16 | {% for post in site.posts %}
17 | {% if post.link %}
18 |
19 | {{ post.title | xml_escape }}
20 | {% if post.excerpt %}
21 | {{ post.excerpt | xml_escape }}
22 | {% else %}
23 | {{ post.content | xml_escape }}
24 | {% endif %}
25 | {{ post.date | date_to_rfc822 }}
26 | {{ post.link | escape }}
27 | {{ site.url }}{{ post.url }}
28 |
29 | {% endif %}
30 | {% endfor %}
31 |
32 |
33 |
--------------------------------------------------------------------------------
/feed.xml:
--------------------------------------------------------------------------------
1 | ---
2 | ---
3 |
4 |
9 |
10 | {{ site.name | xml_escape }}
11 | {% if site.description %}{{ site.description | xml_escape }}{% endif %}
12 | {{ site.feed_update_period | default: "daily" | xml_escape }}
13 | {{ site.feed_update_frequency | default: 1 | xml_escape }}
14 | {{ site.url }}
15 |
16 | {% for post in site.posts limit:1 %}{{ post.date | date_to_rfc822 }}{% endfor %}
17 | {% assign feed_items = site.feed_items | default: 10 %}
18 | {% for post in site.posts limit:feed_items %}
19 |
20 | {{ post.title | xml_escape }}
21 | {% if post.author.name %}
22 | {{ post.author.name | xml_escape }}
23 | {% endif %}
24 | {% if post.excerpt %}
25 | {{ post.excerpt | xml_escape }}
26 | {% else %}
27 | {{ post.content | xml_escape }}
28 | {% endif %}
29 | {{ post.date | date_to_rfc822 }}
30 | {{ site.url }}{{ post.url }}
31 | {{ site.url }}{{ post.url }}
32 |
33 | {% endfor %}
34 |
35 |
36 |
--------------------------------------------------------------------------------