Thursday, March 6, 2014

edx-platform - Using the Standford theme for your production stack

To apply the Standford theme for your edX production stack:

1. Open/create the file /edx/var/edx_ansible/server-vars.yml, and add the following lines:

edxapp_use_custom_theme: true
edxapp_theme_name: 'stanford'
edxapp_theme_source_repo: 'git://github.com/Stanford-Online/edx-theme.git'
edxapp_theme_version: 'HEAD'


2. Then run the provisioning script:

$ sudo /edx/bin/update edx-platform master




Notes and troubleshooting:

1. To customize the theme, fork the Standford theme's repository, change the style, images...or whatever you want, then edit the server-vars.yml file again:

edxapp_use_custom_theme: true
edxapp_theme_name: 'mycustomtheme'
edxapp_theme_source_repo: 'git://github.com/myaccount/edx-theme.git'
edxapp_theme_version: 'HEAD'

Save and exit. Repeat step #2 to apply the new theme to your edx instance.

2. server-vars.yml does not make any changes after running the update bash script

Take a look at this line in the /edx/bin/update bash script to see where the server-vars.yml file should be:

This means you are using an older version of the configuration repo, so create and add your settings in /edx/var/edx_ansible/server-vars.yml:

if [[ -f /edx/var/edx_ansible/server-vars.yml ]]; then
    extra_args="-e@/edx/var/edx_ansible/server-vars.yml"
fi

The following line in /edx/bin/update means you are using the current version of the configuration repo. If so, create and modify your settings in /edx/app/edx_ansible/server-vars.yml:

if [[ -f /edx/app/edx_ansible/server-vars.yml ]]; then
    extra_args="-e@/edx/app/edx_ansible/server-vars.yml"
fi

(this may be changed in the future)


References: https://github.com/edx/edx-platform/wiki/Stanford-Theming