Skip to content

Latest commit

 

History

History

custom-template

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Customizing the HTML template

r8 can be styled with a custom HTML template.

Using a custom template

To use a custom template, you need to set the static_dir setting in your r8 database using any of the following ways:

New r8 installation:

r8 sql init --static-dir ./misc/custom-template --static-dir ./r8/static

Existing r8 installation:

r8 settings set static_dir /absolute/path/to/r8/misc/custom-template /absolute/path/to/r8/r8/static

config.sql:

INSERT OR REPLACE INTO settings (key, value)
VALUES
       ('static_dir', '["/absolute/path/to/r8/misc/custom-template", "/absolute/path/to/r8/r8/static"]')
;

Writing your own template

In short, r8's website is rendered from Jinja2 templates. The static_dir setting governs which template directories are used. It is common to pass two directories: First your custom template directory and second r8's builtin template directory, from which most functionality is inherited.