|
|
@ -10,7 +10,9 @@ class ThemeEngine
|
|
|
|
public function __construct()
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$this->data = json_decode(file_get_contents("./config.json"), true);
|
|
|
|
$this->data = json_decode(file_get_contents("./config.json"), true);
|
|
|
|
$this->loader = new \Twig\Loader\FilesystemLoader("src/themes/");
|
|
|
|
$this->loader = new \Twig\Loader\FilesystemLoader(
|
|
|
|
|
|
|
|
"src/themes/theme-fipamo-default/"
|
|
|
|
|
|
|
|
);
|
|
|
|
$this->twig = new \Twig\Environment($this->loader, []);
|
|
|
|
$this->twig = new \Twig\Environment($this->loader, []);
|
|
|
|
$this->router($_SERVER["REQUEST_URI"]);
|
|
|
|
$this->router($_SERVER["REQUEST_URI"]);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -29,7 +31,7 @@ class ThemeEngine
|
|
|
|
case "/":
|
|
|
|
case "/":
|
|
|
|
$recent = $this->data["recent_posts"];
|
|
|
|
$recent = $this->data["recent_posts"];
|
|
|
|
$featured = $this->data["featured_posts"];
|
|
|
|
$featured = $this->data["featured_posts"];
|
|
|
|
$template = "theme-fipamo-default/fipamo-default/index.twig";
|
|
|
|
$template = "fipamo-default/index.twig";
|
|
|
|
|
|
|
|
|
|
|
|
$pageOptions = [
|
|
|
|
$pageOptions = [
|
|
|
|
"debug" => true,
|
|
|
|
"debug" => true,
|
|
|
@ -45,7 +47,7 @@ class ThemeEngine
|
|
|
|
case "/page":
|
|
|
|
case "/page":
|
|
|
|
$content = $this->data["content"];
|
|
|
|
$content = $this->data["content"];
|
|
|
|
$meta = $this->data["meta"];
|
|
|
|
$meta = $this->data["meta"];
|
|
|
|
$template = "theme-fipamo-default/fipamo-default/page.twig";
|
|
|
|
$template = "fipamo-default/page.twig";
|
|
|
|
$pageOptions = [
|
|
|
|
$pageOptions = [
|
|
|
|
"debug" => true,
|
|
|
|
"debug" => true,
|
|
|
|
"title" => "Page Title",
|
|
|
|
"title" => "Page Title",
|
|
|
@ -59,7 +61,7 @@ class ThemeEngine
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "/tags":
|
|
|
|
case "/tags":
|
|
|
|
$tags = $this->data["tag_list"];
|
|
|
|
$tags = $this->data["tag_list"];
|
|
|
|
$template = "theme-fipamo-default/fipamo-default/tags.twig";
|
|
|
|
$template = "fipamo-default/tags.twig";
|
|
|
|
$pageOptions = [
|
|
|
|
$pageOptions = [
|
|
|
|
"debug" => true,
|
|
|
|
"debug" => true,
|
|
|
|
"title" => "Pages Tagged as Tag",
|
|
|
|
"title" => "Pages Tagged as Tag",
|
|
|
@ -72,7 +74,7 @@ class ThemeEngine
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case "/archive":
|
|
|
|
case "/archive":
|
|
|
|
$archive = $this->data["archives"];
|
|
|
|
$archive = $this->data["archives"];
|
|
|
|
$template = "theme-fipamo-default/fipamo-default/archive.twig";
|
|
|
|
$template = "fipamo-default/archive.twig";
|
|
|
|
$pageOptions = [
|
|
|
|
$pageOptions = [
|
|
|
|
"debug" => true,
|
|
|
|
"debug" => true,
|
|
|
|
"title" => "Archive",
|
|
|
|
"title" => "Archive",
|
|
|
|