diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 7b0575693..f0a8e0a85 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,7 +1,7 @@ - Hyku + <%= Hyku::Application.html_head_title %> <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> <%= csrf_meta_tags %> diff --git a/config/application.rb b/config/application.rb index 1eed55d69..40f2c32f2 100644 --- a/config/application.rb +++ b/config/application.rb @@ -34,6 +34,15 @@ def self.utf_8_encode(string) end class Application < Rails::Application + ## + # @!group Class Attributes + # + # @!attribute html_head_title + # The title to render for the application's HTML > HEAD > TITLE element. + # @return [String] + class_attribute :html_head_title, default: "Hyku", attr_accessor: false + # @!endgroup Class Attributes + # Add this line to load the lib folder first because we need # IiifPrint::SplitPdfs::AdventistPagesToJpgsSplitter config.autoload_paths.unshift("#{Rails.root}/lib") diff --git a/spec/config/application_spec.rb b/spec/config/application_spec.rb new file mode 100644 index 000000000..35ce1619b --- /dev/null +++ b/spec/config/application_spec.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe Hyku::Application do + describe '.html_head_title' do + it { is_expected.to be_a(String) } + end +end