当前位置: 首页 > 软件库 > Web应用开发 > >

jekyll-rss-feeds

授权协议 MIT License
开发语言 JavaScript
所属分类 Web应用开发
软件类型 开源软件
地区 不详
投 递 者 张和豫
操作系统 未知
开源组织
适用人群 未知
 软件概览

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.

  • 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

  • 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.

 相关资料
  • RSS

    Django附带了一个联合供稿生成框架。 有了它,您可以通过django.contrib.syndication.views.Feed class来创建RSS或Atom提要。 让我们为应用程序上的最新评论创建一个feed(另请参阅Django - Comments Framework章节)。 为此,让我们创建一个myapp/feeds.py并定义我们的feed(您可以将您的feed类放在代码结构中

  • Django带有聚合feed生成框架。有了它,你可以创建RSS或Atom只需继承django.contrib.syndication.views.Feed类。 让我们创建一个订阅源的应用程序。 在feed类, title, link 和 description 属性对应标准RSS 的<title>, <link> 和 <description>元素。 条目方法返回应该进入feed的item的元素。

  • RSS Bandit 是一个用 C# 编写的桌面 RSS/ATOM 聚合器

  • RSS-Planet 是一个用来从不同的网站上抓取头条新闻(通过RSS)并通过 xplanet 将这些信息存储在对应的全球地图上。

  • RSS-WML是一个基于WAP/WML的RSS阅读器。需要PHP和MagpieRSS的支持。

  • Luzifer / rss-status rss-status is a read-only bridge between RSS feeds and Mastodon / OStatus applications. The intention behind is for example to subscribe to Github-Status, LatestVer or other feeds