mirror of
https://github.com/mastodon/mastodon.git
synced 2024-08-20 21:08:15 -07:00
Add "next" link to Atom feeds
This commit is contained in:
parent
63b3cb37db
commit
2d8a4c4390
2 changed files with 5 additions and 0 deletions
|
@ -90,6 +90,10 @@ module AtomBuilderHelper
|
||||||
xml.link(rel: 'self', type: 'application/atom+xml', href: url)
|
xml.link(rel: 'self', type: 'application/atom+xml', href: url)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def link_next(xml, url)
|
||||||
|
xml.link(rel: 'next', type: 'application/atom+xml', href: url)
|
||||||
|
end
|
||||||
|
|
||||||
def link_hub(xml, url)
|
def link_hub(xml, url)
|
||||||
xml.link(rel: 'hub', href: url)
|
xml.link(rel: 'hub', href: url)
|
||||||
end
|
end
|
||||||
|
|
|
@ -14,6 +14,7 @@ Nokogiri::XML::Builder.new do |xml|
|
||||||
|
|
||||||
link_alternate xml, TagManager.instance.url_for(@account)
|
link_alternate xml, TagManager.instance.url_for(@account)
|
||||||
link_self xml, account_url(@account, format: 'atom')
|
link_self xml, account_url(@account, format: 'atom')
|
||||||
|
link_next xml, account_url(@account, format: 'atom', max_id: @entries.last.id) if @entries.size == 20
|
||||||
link_hub xml, api_push_url
|
link_hub xml, api_push_url
|
||||||
link_salmon xml, api_salmon_url(@account.id)
|
link_salmon xml, api_salmon_url(@account.id)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue