-
Notifications
You must be signed in to change notification settings - Fork 63
Creating a theme
-
Name your theme (e.g., 'nothumb').
-
Create an image of your theme called {name}_preview.png and add it to app/assets/images/spotlight/themes (e.g., nothumb_preview.png)
-
Edit application.css so that it doesn't have the call to include the tree or it will include itself in your theme's call. You have to individually call all of the necessary files:
/*= require blacklight_gallery.css.scss
*= require blacklight_oembed.css.scss
*= require blacklight.scss
*= require openseadragon.css
*= require spotlight.scss
*/-
Create your CSS file called application_{name}.css and place it in app/assets/stylesheets
-
Add a precompile call for your CSS file in config/initializers/assets.rb:
Rails.application.config.assets.precompile += %w( application_nothumb.css ) -
Add your theme name to config/initializers/spotlight_initializer.rb:
Spotlight::Engine.config.exhibit_themes = %w[nothumb default]
The method above makes the configured themes available to all exhibits. If you would like to create your own exhibit specific theme availability logic, you can set provide code to do that as a Proc set as the Spotlight::Exhibit.themes_selector. This Proc will receive the exhibit instance so any data about the exhibit can be used to determine the list of themes that should be available.
Spotlight::Exhibit.themes_selector = ->(exhibit) do
if exhibit.slug == 'exhibit-that-gets-custom-theme'
%[default customTheme]
else
%[default]
end
endAbout Spotlight - for Newcomers
- What is Spotlight?
- Connect With Us
- Exhibit Creator Release Notes
- Institutional Spotlight Sites
- Examples & Demos
Configuration - for Developers
- How to Contribute
- Installation
- User Roles
- Blacklight
- Page Widgets
- Resource Scenarios
- Image Sizes
- Queueing Backends
- Creating a Theme
- Configure S3 Data Storage
- Translations and Internationalization
- Adding New Navigation Menu Items
- Stanford Case Study
Building an Exhibit - for Creators