-
Notifications
You must be signed in to change notification settings - Fork 257
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
17 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,8 @@ | |
<%= opensearch_description_tag application_name, opensearch_catalog_url(format: 'xml') %> | ||
<%= favicon_link_tag %> | ||
<%= stylesheet_link_tag "application", media: "all", "data-turbo-track": "reload" %> | ||
<%= stylesheet_link_tag "https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" unless defined? Propshaft %> | ||
|
||
<% if defined? Importmap %> | ||
<%= javascript_importmap_tags %> | ||
<% elsif defined? Propshaft %> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ def import_javascript_assets | |
<<~CONTENT | ||
pin "@github/auto-complete-element", to: "https://cdn.skypack.dev/@github/auto-complete-element" | ||
pin "@popperjs/core", to: "https://ga.jspm.io/npm:@popperjs/[email protected]/dist/umd/popper.min.js" | ||
pin "bootstrap", to: "https://ga.jspm.io/npm:bootstrap@#{(defined?(Bootstrap) && Bootstrap::VERSION) || '5.3.2'}/dist/js/bootstrap.js" | ||
pin "bootstrap", to: "https://ga.jspm.io/npm:bootstrap@#{(defined?(Bootstrap) && Bootstrap::VERSION) || '5.3.3'}/dist/js/bootstrap.js" | ||
CONTENT | ||
end | ||
|
||
|
@@ -40,41 +40,19 @@ def append_blacklight_javascript | |
end | ||
|
||
def add_stylesheet | ||
unless used_bootstrap_css? | ||
generate_with_sassc_rails | ||
return | ||
end | ||
|
||
if ENV['CI'] | ||
run "yarn add file:#{Blacklight::Engine.root}" | ||
if File.exist? 'app/assets/stylesheets/application.bootstrap.scss' | ||
append_to_file 'app/assets/stylesheets/application.bootstrap.scss' do | ||
<<~CONTENT | ||
@import url("blacklight.css"); | ||
CONTENT | ||
end | ||
else | ||
run "yarn add blacklight-frontend@#{Blacklight::VERSION}" | ||
end | ||
|
||
append_to_file 'app/assets/stylesheets/application.bootstrap.scss' do | ||
<<~CONTENT | ||
@import "blacklight-frontend/app/assets/stylesheets/blacklight/blacklight"; | ||
CONTENT | ||
end | ||
end | ||
|
||
private | ||
|
||
# Did they generate the rails app with `--css bootstrap' ? | ||
def used_bootstrap_css? | ||
File.exist? 'app/assets/stylesheets/application.bootstrap.scss' | ||
end | ||
|
||
def generate_with_sassc_rails | ||
gem "sassc-rails", "~> 2.1" | ||
# This could be skipped if you want to use shakapacker or cssbunding-rails | ||
gem 'bootstrap', options[:'bootstrap-version'].presence | ||
|
||
create_file 'app/assets/stylesheets/blacklight.scss' do | ||
<<~CONTENT | ||
@import 'bootstrap'; | ||
@import 'blacklight/blacklight'; | ||
CONTENT | ||
append_to_file 'app/assets/stylesheets/application.css' do | ||
<<~CONTENT | ||
@import url("blacklight.css"); | ||
@import stylesheet_path("blacklight.css"); | ||
CONTENT | ||
end | ||
end | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters