NAME

LibreCat::Layers - A mechanism to load custom config, templates, assets and code on top of LibreCat

SYNOPSIS

    use LibreCat::Layers;
    my $layers = LibreCat::Layers->new;
    my $config = $layers->config;
    $layers->load;

The LibreCat web application, commandline tool and tests are already layers aware.

DESCRIPTION

This module provides a mechanism to load configuration, templates, static assets and code to customize the stock LibreCat application. All you need to do is write a layers.yml configuration file at the root of the application listing the directories where LibreCat can find your customizations.

This is a sample layers.yml file with 2 customization layers:

    - /path/to/layer2
    - /path/to/layer1

layer2 will override layer1 which will in turn override the stock application.

Relative paths to layers are searched from the root of the application.

LAYER STRUCTURE

Custom YAML configuration files can be placed in a config directory.

Custom templates can be placed in either a views or templates directory.

Custom static assets can be placed in a public directory.

Custom code can be placed in a lib directory.

ENVIRONMENT VARIABLES

You can also configure layers through the LIBRECAT_LAYERS environment variable, in which case the layers.yml file will be ignored.

    LIBRECAT_LAYERS=/path/to/layer2,/path/to/layer1 bin/librecat

METHODS

new

PARAMETERS

root_path
layer_paths

css_paths

config

config_paths

lib_paths

layer_paths

paths

public_paths

root_path

scss_paths

template_paths