Branding devilry

Simple branding with templates

Setup

First, you need to create a directory to hold custom templates. This directory needs to have a subdirectory named devilry_deploy, and it is in this subdirectory you will add your custom templates. For this guide, we will assume you use ~/devilrydeploy/custom_devilry_templates/:

$ mkdir ~/devilrydeploy/custom_devilry_templates/
$ mkdir ~/devilrydeploy/custom_devilry_templates/devilry_deploy/

When the directory is created, you need to add it to your ~/devilry_deploy/devilry_settings.py:

from devilry.utils.custom_templates import add_custom_templates_directory
add_custom_templates_directory(
    TEMPLATES,
    '/absolute/path/to/devilrydeploy/custom_devilry_templates/')

Add a custom favicon

You can set your own favicon by adding the url to the png-file in your ~/devilrydeploy/devilry_settings.py file:

DEVILRY_BRANDING_FAV_ICON_PATH = 'url/to/favicon.png'

Add custom CSS

To add custom CSS, you need to create ~/devilrydeploy/custom_devilry_templates/devilry_deploy/custom_css.django.css.

Lets make the color of all text in the footer red:

{% extends "devilry_deploy/custom_css_base.django.html" %}

{% block css %}
    .footer {
        color: red;
    }
{% endblock css %}

You can override any CSS from Devilry, but be VERY careful. Generally speaking, you should mostly use this to add css classes that you use in custom templates, such as the footer documented above.

Available template variables

Template variables you can use in your branding templates:

  • DEVILRY_VERSION: The devilry version (Example: 3.0.0)

  • DEVILRY_CHANGELOG_URL: The URL for the user friendly changelog.

Advanced branding

You can go much further than the simple branding provided with templates above. If you know Django, you can override a lot of templates, and if you know LESS, you can create your own theme. We do not have a guide for this at this time. Generally, we do not recommend this since it will require you to keep up to date with changes in the Devilry styles and templates.