Commonwealth-VLR-Engine is a Rails engine for creating Blacklight apps that provide access to content from Solr/Fedora, packaging a number of feature-rich enhancements and modifications.
To provide better search engine indexing and reduce the amount of traffic on search/facet pages, we should implement a sitemap.
The blacklight_dynamic_sitemap gem offers useful functionality for this. The installer basically just adds this line to the app's config/routes.rb file, which could easily be emulated in commonwealth-vlr-engine's installer:
mount BlacklightDynamicSitemap::Engine => '/'
However, there are some drawbacks specific to our use case:
collection and institution pages are indexed as "regular" Solr documents (/search/ark_id) rather than their distinct classes (e.g. /collections/ark_id)
static pages are not included
The first issue may be solvable by overriding some code from the gem, not sure how difficult that will be.
The second issue will take more wrangling, we may want to include a controller-level callback to dynamically include the static pages, maybe using a YAML file as the data source for the URLs to be included. That list could easily be maintained in downstream applications.
Other considerations:
The gem requires the presence of a hashed identifier field, we will need to implement the sitemap-support branch of solr-core-conf and reindex all non-FileSet documents
The hashed field we will use will be hashed_id_si, this is slightly different than the field used by default in the gem (hashed_id_ssi)
To provide better search engine indexing and reduce the amount of traffic on search/facet pages, we should implement a sitemap.
The blacklight_dynamic_sitemap gem offers useful functionality for this. The installer basically just adds this line to the app's
config/routes.rb
file, which could easily be emulated in commonwealth-vlr-engine's installer:However, there are some drawbacks specific to our use case:
/search/ark_id
) rather than their distinct classes (e.g./collections/ark_id
)The first issue may be solvable by overriding some code from the gem, not sure how difficult that will be.
The second issue will take more wrangling, we may want to include a controller-level callback to dynamically include the static pages, maybe using a YAML file as the data source for the URLs to be included. That list could easily be maintained in downstream applications.
Other considerations:
sitemap-support
branch of solr-core-conf and reindex all non-FileSet documentshashed_id_si
, this is slightly different than the field used by default in the gem (hashed_id_ssi
)