diff --git a/index.php b/index.php new file mode 100644 index 0000000..b464ade --- /dev/null +++ b/index.php @@ -0,0 +1,7 @@ +render('index.twig.html', ['animal' => 'cat girl']); + +?> diff --git a/public_html/index.php b/public_html/index.php deleted file mode 100644 index f292231..0000000 --- a/public_html/index.php +++ /dev/null @@ -1,5 +0,0 @@ - - -Placeholder. diff --git a/res/lib/load.php b/res/lib/load.php index 62a2de0..afdfccf 100644 --- a/res/lib/load.php +++ b/res/lib/load.php @@ -1,3 +1,17 @@ PATH +// Take a path from root and turn it into a relative path. +function root($path) { + return $GLOBALS['depth'] . $path; +} + +// ------------------------------------- + +require_once root("vendor/autoload.php"); + +$loader= new Twig_Loader_Filesystem(root("res/themes/default/html")); +$twig = new Twig_Environment($loader, ['cache' => + root('cache/')]); + ?> diff --git a/res/themes/default/html/index.twig.html b/res/themes/default/html/index.twig.html index 978d7b8..c806fd0 100644 --- a/res/themes/default/html/index.twig.html +++ b/res/themes/default/html/index.twig.html @@ -6,5 +6,6 @@
{{ animal }}s are SUPER RAD.