-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #477 from trln/TD-1392-rss
Fix RSS feeds. Fixes TD-1392.
- Loading branch information
Showing
3 changed files
with
20 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# frozen_string_literal: true | ||
|
||
# TRLN CUSTOMIZATION: add title & responsibility to <title> tag; omit <author>. See: | ||
# https://github.com/projectblacklight/blacklight/blob/release-8.x/app/views/catalog/_document.rss.builder | ||
xml.item do | ||
xml.title(document.title_and_responsibility) | ||
xml.link(polymorphic_url(search_state.url_for_document(document))) | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
# TRLN CUSTOMIZATION: Fix link to catalog. See: | ||
# https://github.com/projectblacklight/blacklight/blob/release-8.x/app/views/catalog/index.rss.builder | ||
xml.instruct! :xml, version: '1.0' | ||
xml.rss(version: '2.0') do | ||
xml.channel do | ||
xml.title(t('blacklight.search.title', application_name: application_name)) | ||
xml.title(t('blacklight.search.page_title.title', constraints: render_search_to_page_title(params), | ||
application_name: application_name)) | ||
# BL core renders <link> with catalog.rss, so we fix it here | ||
# xml.link(search_action_url(search_state.to_h.merge(only_path: false))) | ||
xml.link(search_action_url(params.merge(format: '').to_unsafe_h)) | ||
xml.description(t('blacklight.search.title', application_name: application_name)) | ||
xml.description(t('blacklight.search.page_title.title', constraints: render_search_to_page_title(params), | ||
application_name: application_name)) | ||
xml.language('en-us') | ||
@document_list.each_with_index do |document, document_counter| | ||
xml << Nokogiri::XML.fragment( | ||
render_document_partials(document, | ||
blacklight_config.view_config(:rss).partials, | ||
@response.documents.each_with_index do |document, document_counter| | ||
xml << render_xml_partials(document, blacklight_config.view_config(:rss).partials, | ||
document_counter: document_counter) | ||
) | ||
end | ||
end | ||
end |