-
Notifications
You must be signed in to change notification settings - Fork 65
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
end
Configuration
- Blacklight
- Page widgets
- Resource scenarios
- Image sizes
- Queueing backends
- Creating a theme
- Configure S3 data storage
- Translations and Internationalization
- Adding new navigation menu items
Case studies
Building an exhibit
- Quickstart guide
- Configuration settings
- Adding and managing items
- Creating feature pages
- Creating about pages
- Creating browse categories
- Exhibit on exhibits - Stanford specific, yet generalizable
Development