GithubHelp home page GithubHelp logo

happy-ferret / jekyll-rss-feeds Goto Github PK

View Code? Open in Web Editor NEW

This project forked from georgemandis/jekyll-rss-feeds

0.0 2.0 0.0 26 KB

Templates for rendering RSS feeds for your Jekyll blog

Home Page: http://snaptortoise.com/open-source.html

License: MIT License

jekyll-rss-feeds's Introduction

Jekyll RSS Feed Templates

NOTE: If you're a fan of this project you should checkout the sister project: jekyll-json-feeds.

A few Liquid templates to use for rendering RSS feeds for your Jekyll blog. Featuring four kinds of feeds:

  • feed.xml — Renders the 10 most recent posts.
  • feed.category.xml — Only renders posts for a specific category. This example renders posts for a "miscellaneous" category.
  • feed.links.xml — Only contains posts that link to external websites noted by a link variable in the YAML Front Matter. Not a common Jekyll convention, but a good way to generating a linked list.
  • feed.articles.xml — Only showing articles that don't link to external sites; The opposite of feed.links.xml

How to use

  • Update _config.yml as noted below, or manually replace the variables.
  • Copy one of the xml (ie, feed.xml) files to the root directory of your Jekyll blog.
  • Run jekyll.

In your generated _site folder you should find a properly formatted feed at feed.xml.

Customizing _config.yml

These templates rely on a customized version of _config.yml. The following lines have been added:

name: Your Blog's Name
description: A description for your blog
url: http://your-blog-url.example.com
feed_items: 10
feed_update_period: daily
feed_update_frequency: 1

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.

The feed_* items shown above are the default. You can safely omit them.

Miscellany

  • Note on YAML Front Matter block: The xml files contain an empty 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. 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

  • 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):

      <link href="/blog/feed.xml" type="application/rss+xml" rel="alternate" title="Latest 10 blog posts (atom)" />
    

    Refer to rssboard.org/rss-autodiscovery for details.

  • Validation: You can use the W3C Validator to make sure your feeds are formatted correctly: http://validator.w3.org/feed/

  • If you're a Pinboard user and found this repo useful, take a look at jekyll-pinboard. It allows you to load your Pinboard bookmarks into your Jekyll site with just a couple lines.

  • If you're looking for JSON feed templates to add to your Jekyll blog please checkout the sister project: jekyll-json-feeds.

jekyll-rss-feeds's People

Contributors

dsernst avatar fabacab avatar georgemandis avatar hizzgdev avatar integrii avatar jclgoodwin avatar jillro avatar jmdh avatar nickcotton avatar paulroho avatar tanner avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.