diff --git a/app/views/catalog/_document.rss.builder b/app/views/catalog/_document.rss.builder new file mode 100644 index 00000000..bf6fc9df --- /dev/null +++ b/app/views/catalog/_document.rss.builder @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +# TRLN CUSTOMIZATION: add title & responsibility to 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 diff --git a/app/views/catalog/_document_default.rss.builder b/app/views/catalog/_document_default.rss.builder deleted file mode 100644 index fcf29cf0..00000000 --- a/app/views/catalog/_document_default.rss.builder +++ /dev/null @@ -1,4 +0,0 @@ -xml.item do - xml.title(document.title_and_responsibility) - xml.link(polymorphic_url(url_for_document(document))) -end diff --git a/app/views/catalog/index.rss.builder b/app/views/catalog/index.rss.builder index f04ed098..7986cd31 100644 --- a/app/views/catalog/index.rss.builder +++ b/app/views/catalog/index.rss.builder @@ -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