:memo: Jekyll 插件,用于生成您的 Jekyll 文章的 Atom (类似 RSS) 订阅源
A Jekyll plugin to generate an Atom (RSS-like) feed of your Jekyll posts
Add this line to your site's Gemfile:
gem 'jekyll-feed'
And then add this line to your site's _config.yml:
plugins:
- jekyll-feed
:warning: If you are using Jekyll ` section, to output the necessary metadata.
The plugin uses Jekyll's smartify filter for processing the site title and post titles. This will translate plain ASCII punctuation into "smart" typographic punctuation. This will not render or strip any Markdown you may be using in a title.
Jekyll's smartify filter uses kramdown as a processor. Accordingly, if you do not want "smart" typographic punctuation, disabling them in kramdown in your _config.yml will disable them in your feed. For example:
kramdown:
smart_quotes: apos,apos,quot,quot
typographic_symbols: {hellip: ...}
Want to style what your feed looks like in the browser? When a XSLT Styleheet file named feed.xslt.xml exists at the root of your repository, a link to this stylesheet is added to the generated feed.
Great question. In short, Atom is a better format. Think of it like RSS 3.0. For more information, see this discussion on why we chose Atom over RSS 2.0.
Jekyll Feed can generate feeds for each category. Simply define which categories you'd like feeds for in your config:
feed:
categories:
- news
- updates
By default the plugin limits the number of posts in the feed to 10. Simply define a new limit in your config:
feed:
posts_limit: 20
Jekyll Feed can generate feeds for collections other than the Posts collection. This works best for chronological collections (e.g., collections with dates in the filenames). Simply define which collections you'd like feeds for in your config:
feed:
collections:
- changes
By default, collection feeds will be outputted to /feed/.xml. If you'd like to customize the output path, specify a collection's custom path as follows:
feed:
collections:
changes:
path: "/changes.atom"
Finally, collections can also have category feeds that are outputted as /feed//.xml. Specify categories like so:
feed:
collections:
changes:
path: "/changes.atom"
categories:
- news
- updates
Optional flag excerpt_only allows you to exclude post content from the Atom feed. Default value is false for backward compatibility.
When in config.yml is true then all posts in feed will be without `` tags.
feed:
excerpt_only: true
The same flag can be used directly in post file. It will disable `` tag for selected post. Settings in post file have higher priority than in config file.
To automatically generate feeds for each tag you apply to your posts you can add a tags setting to your config:
feed:
tags: true
If there are tags you don't want included in this auto generation you can exclude them
feed:
tags:
except:
- tag-to-exclude
- another-tag
If you wish to change the location of these auto generated feeds (/feed/by_tag/.xml by default) you can provide an alternative folder for them to live in.
feed:
tags:
path: "alternative/path/for/tags/feeds/"
If you only want to generate feeds for a few tags you can also set this.
feed:
tags:
only:
- tag-to-include
- another-tag
Note that if you include a tag that is excluded a feed will not be generated for it.
Use disable_in_development: true if you want to turn off feed generation when jekyll.environment == "development",
but don't want to remove the plugin (so you don't accidentally commit the removal). Default value is false.
feed:
disable_in_development: true
git checkout -b my-new-feature)git commit -am 'Add some feature')git push origin my-new-feature)暂无开放 Issues,或尚未同步最近议题。