Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add item content #36

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/rss.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ function generateXML (data){
ifTruePush(item.description, item_values, { description: { _cdata: item.description } });
ifTruePush(item.url, item_values, { link: item.url });
ifTruePush(item.link || item.guid || item.title, item_values, { guid: [ { _attr: { isPermaLink: !item.guid && !!item.url } }, item.guid || item.url || item.title ] });
ifTruePush(item.content, item_values, { 'content:encoded': { _cdata: item.content } });

item.categories.forEach(function(category) {
ifTruePush(category, item_values, { category: { _cdata: category } });
Expand Down Expand Up @@ -139,6 +140,7 @@ function RSS (options, items) {
description: options.description || '',
url: options.url,
guid: options.guid,
content: options.content,
categories: options.categories || [],
author: options.author,
date: options.date,
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ feed.item(itemOptions);
* `guid` **unique string** A unique string feed readers use to know if an item is new or has already been seen.
If you use a guid never change it. If you don't provide a guid then your item urls must
be unique.
* `content` **string** Long form content for the item. Sets the content:encoded tag of the rss xml.
* `categories` _optional_ **array of strings** If provided, each array item will be added as a category element
* `author` _optional_ **string** If included it is the name of the item's creator.
If not provided the item author will be the same as the feed author. This is typical
Expand Down
Loading