Class: Blacklight::Allmaps::BlacklightGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Blacklight::Allmaps::BlacklightGenerator
- Defined in:
- lib/generators/blacklight/allmaps/blacklight_generator.rb
Instance Method Summary collapse
- #add_bl_georeferenced_facet ⇒ Object
- #add_bl_stylesheets ⇒ Object
- #add_configuration ⇒ Object
- #add_yarn_package ⇒ Object
- #include_blacklight_allmaps_solrdocument ⇒ Object
Instance Method Details
#add_bl_georeferenced_facet ⇒ Object
41 42 43 44 45 |
# File 'lib/generators/blacklight/allmaps/blacklight_generator.rb', line 41 def add_bl_georeferenced_facet inject_into_file "app/controllers/catalog_controller.rb", after: "config.add_facet_field 'subject_era_ssim', label: 'Era'" do "\n config.add_facet_field 'bl_georeferenced_bsi', label: I18n.t('allmaps.bl_facet_label')" end end |
#add_bl_stylesheets ⇒ Object
19 20 21 22 23 |
# File 'lib/generators/blacklight/allmaps/blacklight_generator.rb', line 19 def add_bl_stylesheets append_to_file "app/assets/stylesheets/blacklight.scss" do "@import 'blacklight/allmaps/base';" end end |
#add_configuration ⇒ Object
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/generators/blacklight/allmaps/blacklight_generator.rb', line 30 def add_configuration inject_into_file "app/controllers/catalog_controller.rb", after: "#config.show.thumbnail_field = 'thumbnail_path_ss'" do "\n # Blacklight::Allmaps Viewer config.show.partials.insert(1, :blacklight_allmaps) config.default_solr_unique_key = \"id\" config.default_georeferenced_field = \"bl_georeferenced_bsi\" config.default_iiif_manifest_field = \"iiif_manifest_url_ssi\"" end end |
#add_yarn_package ⇒ Object
25 26 27 28 |
# File 'lib/generators/blacklight/allmaps/blacklight_generator.rb', line 25 def add_yarn_package copy_file "package.json", "package.json" run "yarn install" end |
#include_blacklight_allmaps_solrdocument ⇒ Object
47 48 49 50 51 |
# File 'lib/generators/blacklight/allmaps/blacklight_generator.rb', line 47 def include_blacklight_allmaps_solrdocument inject_into_file "app/models/solr_document.rb", after: "include Blacklight::Solr::Document" do "\n include Blacklight::Allmaps::SolrDocument" end end |