quick patch to render class for dynamic theme rendering

pull/84/head
Ro 4 years ago
parent f3dfd3411a
commit 95aecde73b

@ -15,6 +15,7 @@ class Render
$this->twig = new \Twig\Environment($this->loader, []); $this->twig = new \Twig\Environment($this->loader, []);
$settings = $config->getSettings(); $settings = $config->getSettings();
$this->menu = $settings["menu"]; $this->menu = $settings["menu"];
$this->theme = $settings["global"]["theme"];
$this->pageInfo = [ $this->pageInfo = [
"keywords" => isset($settings["global"]["keywords"]) "keywords" => isset($settings["global"]["keywords"])
? $settings["global"]["keywords"] ? $settings["global"]["keywords"]
@ -104,7 +105,7 @@ class Render
//$cleaned = html_entity_decode($cleaned, ENT_QUOTES, "UTF-8"); //$cleaned = html_entity_decode($cleaned, ENT_QUOTES, "UTF-8");
if ($page["layout"] == "index") { if ($page["layout"] == "index") {
$template = "fipamo-default/index.twig"; $template = $this->theme . "/index.twig";
$location = "../public/index.html"; $location = "../public/index.html";
$dir = null; $dir = null;
@ -119,7 +120,7 @@ class Render
"menu" => $this->menu, "menu" => $this->menu,
]; ];
} else { } else {
$template = "fipamo-default/page.twig"; $template = $this->theme . "/page.twig";
$location = $location =
"../public/" . $page["path"] . "/" . $page["slug"] . ".html"; "../public/" . $page["path"] . "/" . $page["slug"] . ".html";
$dir = "../public/" . $page["path"]; $dir = "../public/" . $page["path"];
@ -142,7 +143,7 @@ class Render
public function renderArchive() public function renderArchive()
{ {
$archive = Sorting::archive(); $archive = Sorting::archive();
$template = "fipamo-default/archive.twig"; $template = $this->theme . "/archive.twig";
$pageOptions = [ $pageOptions = [
"title" => "Archive", "title" => "Archive",
"background" => $this->pageInfo["image"], "background" => $this->pageInfo["image"],
@ -160,7 +161,7 @@ class Render
{ {
$list = Sorting::tags(); $list = Sorting::tags();
foreach ($list as $item) { foreach ($list as $item) {
$template = "fipamo-default/tags.twig"; $template = $this->theme . "/tags.twig";
$pageOptions = [ $pageOptions = [
"title" => "Pages Tagged as " . $item["tag_name"], "title" => "Pages Tagged as " . $item["tag_name"],
"background" => $this->pageInfo["image"], "background" => $this->pageInfo["image"],

Loading…
Cancel
Save