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

Icon and logo support #400

Open
wants to merge 5 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
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ The plugin will automatically use any of the following configuration variables,
* `description` - A longer description of what your site is about, e.g., "Where I blog about Jekyll and other awesome things"
* `url` - The URL to your site, e.g., `https://example.com`. If none is provided, the plugin will try to use `site.github.url`.
* `author` - Global author information (see below)
* `feed.icon` - Icon with 1:1 proportions for readers to use for the blog feed (not supported by all readers; often overridden by a favicon or site icon)
* `feed.logo` - Logo with 2:1 proportions for readers to use for the blog feed (not supported by all readers).
For example, both of the preceding can be expressed:
```yml
feed:
icon: /images/icon.png
logo: /images/logo.png
```


### Already have a feed path?

Expand Down
16 changes: 16 additions & 0 deletions lib/jekyll-feed/feed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,22 @@
<subtitle>{{ site.description | xml_escape }}</subtitle>
{% endif %}

{% if site.feed.icon %}
{% assign feed_icon = site.feed.icon %}
{% unless feed_icon contains "://" %}
{% assign feed_icon = feed_icon | absolute_url %}
{% endunless %}
<icon>{{ feed_icon | xml_escape }}</icon>
{% endif %}

{% if site.feed.logo %}
{% assign feed_logo = site.feed.logo %}
{% unless feed_logo contains "://" %}
{% assign feed_logo = feed_logo | absolute_url %}
{% endunless %}
<logo>{{ feed_logo | xml_escape }}</logo>
{% endif %}

{% if site.author %}
<author>
<name>{{ site.author.name | default: site.author | xml_escape }}</name>
Expand Down
Loading