static function register()
    {
        if (static::$registered) {
            return 'StaticBuilder is already enabled';
        }
        if (!C::get('staticbuilder', false)) {
            return 'StaticBuilder does not seem to be enabled in your config. See https://github.com/fvsch/kirby-staticbuilder/blob/master/doc/install.md for instructions.';
        }
        $kirby = kirby();
        if (!class_exists('Kirby\\Registry')) {
            throw new Exception('Twig plugin requires Kirby 2.3 or higher. Current version: ' . $kirby->version());
        }
        $kirby->set('route', [
            'pattern' => 'staticbuilder',
            'action' => 'Kirby\\StaticBuilder\\Controller::siteAction',
            'method' => 'GET|POST'
        ]);
        $kirby->set('route', [
            'pattern' => 'staticbuilder/(:all)',
            'action' => 'Kirby\\StaticBuilder\\Controller::pageAction',
            'method' => 'GET|POST'
        ]);
        static::$registered = true;
        return 'Enabled StaticBuilder routes.';
    }