Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

External assets

Tuuli Pöllänen edited this page Feb 7, 2019 · 2 revisions

Champaign has a set of default assets in the repository. They have a kind of a generic look to them and are intended to demonstrate an agnostic design on the campaign pages. The idea is to override the generic assets with your own assets. You can look at the assets that SumOfUs uses to override the default assets in our assets repository.

When you're developing Champaign locally, you'll want to use the external assets repository, too. You can clone the SOU assets repository (or use your own), and set the value in the files used by the Settings class to tell Champaign where to look for external assets. For example, in my development.local.yml settings file I keep for local development, I have the following values, because I'm using my local sou-assets repository for the assets. Because people might prefer a different structure to their assets repository, I also need to give it the paths to the different asset types:

external_assets_path: '/home/tuuli/sou-assets'
external_css_path: 'stylesheets/champaign'
external_js_path: 'javascripts/champaign'
external_translation_path: 'translations'
external_liquid_path: 'templates'

For a production build, we have a rake task for downloading external assets bundle exec rake assets:download_external_assets (which takes some arguments - look at lib/tasks/assets.rake) from the remote assets repository from a specified branch. Once you have the assets downloaded, you can issue rake assets:precompile - the usual precompilation task from the Rails Asset Pipeline - to precompile your assets from your external assets source together with the necessary Champaign assets.

Clone this wiki locally