Skip to content

Commit

Permalink
Extract a header component
Browse files Browse the repository at this point in the history
This avoids a deprecation warning from Spotlight
  • Loading branch information
jcoyne committed Jan 10, 2025
1 parent e3e8f1f commit f02429d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<span class="background-container-gradient"></span>
<nav class="navbar navbar-expand navbar-dark topbar" role="navigation" aria-label="<%= t('spotlight.topbar.label') %>">
<div class="<%= container_classes %>">
<%= link_to main_app.root_url, class: 'navbar-brand' do %>
<div class="<%= helpers.container_classes %>">
<%= link_to helpers.main_app.root_url, class: 'navbar-brand' do %>
<%= image_tag 'logo.png', class: 'dlme-logo', alt: '', role: 'presentation' %>
<%= t('application_name') %>
<% end %>
Expand Down
4 changes: 4 additions & 0 deletions app/components/header_component.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# frozen_string_literal: true

class HeaderComponent < Spotlight::HeaderComponent
end
1 change: 1 addition & 0 deletions app/controllers/catalog_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class CatalogController < ApplicationController
config.crawler_detector = ->(req) { req.env['HTTP_USER_AGENT'] && req.env['HTTP_USER_AGENT'] =~ /bot/i }
config.max_page = 100

config.header_component = HeaderComponent
config.document_solr_path = 'get'
config.document_unique_id_param = 'ids'
config.raw_endpoint.enabled = true
Expand Down

0 comments on commit f02429d

Please sign in to comment.