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

Hub Support #403

Open
wants to merge 1 commit 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,15 @@ feed:
disable_in_development: true
```

## Hub

To set a Hub in your feed, simply define set the following in your config:

```yml
feed:
hub: https://your-hub-here.com
```

## Contributing

1. Fork it (https://github.com/jekyll/jekyll-feed/fork)
Expand Down
1 change: 1 addition & 0 deletions lib/jekyll-feed/feed.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<generator uri="https://jekyllrb.com/" version="{{ jekyll.version }}">Jekyll</generator>
<link href="{{ page.url | absolute_url }}" rel="self" type="application/atom+xml" />
<link href="{{ '/' | absolute_url }}" rel="alternate" type="text/html" {% if site.lang %}hreflang="{{ site.lang }}" {% endif %}/>
{% if site.feed.hub %}<link rel="hub" href="{{site.feed.hub}}" />{% endif %}
<updated>{{ site.time | date_to_xmlschema }}</updated>
<id>{{ page.url | absolute_url | xml_escape }}</id>

Expand Down
10 changes: 10 additions & 0 deletions spec/jekyll-feed_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,16 @@ def to_s
end
end
end
context "with hub option" do
let(:overrides) do
{ "feed" => { "hub" => "https://hub.com" } }
end

it "inserts the hub url in the feed.xml file" do
expect(contents).to match "https://hub.com"
end
end


context "with skip_development" do
let(:overrides) do
Expand Down