Fix fixed path in theme_url Twig variable

This commit is contained in:
Matias Griese 2015-01-10 17:55:28 +02:00
parent 6e39107d45
commit 7f526cea76
2 changed files with 6 additions and 7 deletions

View File

@ -17,14 +17,16 @@ define('ASSETS_DIR', ROOT_DIR . 'assets/');
define('CACHE_DIR', ROOT_DIR . 'cache/');
define('IMAGES_DIR', ROOT_DIR . 'images/');
define('LOG_DIR', ROOT_DIR .'logs/');
define('VENDOR_DIR', ROOT_DIR .'vendor/');
define('LIB_DIR', SYSTEM_DIR .'src/');
define('ACCOUNTS_DIR', USER_DIR .'accounts/');
define('DATA_DIR', USER_DIR .'data/');
define('PAGES_DIR', USER_DIR .'pages/');
// DEPRECATED: Do not use!
define('DATA_DIR', USER_DIR .'data/');
define('LIB_DIR', SYSTEM_DIR .'src/');
define('PLUGINS_DIR', USER_DIR .'plugins/');
define('THEMES_DIR', USER_DIR .'themes/');
define('VENDOR_DIR', ROOT_DIR .'vendor/');
// END DEPRECATED
// Some extensions
define('CONTENT_EXT', '.md');

View File

@ -125,9 +125,6 @@ class Twig
$this->grav->fireEvent('onTwigExtensions');
$theme = $config->get('system.pages.theme');
$themeUrl = $this->grav['base_url'] .'/'. USER_PATH . basename(THEMES_DIR) .'/'. $theme;
// Set some standard variables for twig
$this->twig_vars = array(
'grav' => $this->grav,
@ -138,7 +135,7 @@ class Twig
'base_url_absolute' => $this->grav['base_url_absolute'],
'base_url_relative' => $this->grav['base_url_relative'],
'theme_dir' => $locator->findResource('theme://'),
'theme_url' => $themeUrl,
'theme_url' => $this->grav['base_url'] .'/'. $locator->findResource('theme://', false),
'site' => $config->get('site'),
'assets' => $this->grav['assets'],
'taxonomy' => $this->grav['taxonomy'],