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 ability to customize atom:icon #69

Merged
merged 2 commits into from
Dec 26, 2018
Merged
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ feed:
content_limit: 140
content_limit_delim: ' '
order_by: -date
icon: icon.png
```

- **type** - Feed type. (atom/rss2)
Expand All @@ -41,3 +42,4 @@ feed:
- **content_limit** - (optional) Default length of post content used in summary. Only used, if **content** setting is false and no custom post description present.
- **content_limit_delim** - (optional) If **content_limit** is used to shorten post contents, only cut at the last occurrence of this delimiter before reaching the character limit. Not used by default.
- **order_by** - Feed order-by. (Default: -date)
- **icon** - (optional) Custom feed icon. Defaults to a gravatar of email specified in the main config.
3 changes: 2 additions & 1 deletion lib/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ module.exports = function(locals) {
if (url[url.length - 1] !== '/') url += '/';

var icon;
if (config.email) icon = gravatar(config.email);
if (feedConfig.icon) icon = url + feedConfig.icon;
else if (config.email) icon = gravatar(config.email);

var xml = template.render({
config: config,
Expand Down