From fa4b252d9c4e498a85f75bd7dd273009a5f6e5c1 Mon Sep 17 00:00:00 2001 From: Ro Date: Fri, 28 Apr 2023 14:08:49 -0700 Subject: [PATCH] Fix for #94 Header images were missing from the archive and tags pages, so this is a patch to make sure those are working again. --- brain/api/v1/SettingsAPI.php | 1 + brain/data/Render.php | 2 ++ 2 files changed, 3 insertions(+) diff --git a/brain/api/v1/SettingsAPI.php b/brain/api/v1/SettingsAPI.php index 974d30a..fd24eb3 100644 --- a/brain/api/v1/SettingsAPI.php +++ b/brain/api/v1/SettingsAPI.php @@ -38,6 +38,7 @@ class SettingsAPI } else { $render = new Render(); if (isset($themeConfig['render'])) { + //rendering for one page sites if (!$themeConfig['render'] || $themeConfig['render'] === 'false') { $render->renderIndex(); $result = [ diff --git a/brain/data/Render.php b/brain/data/Render.php index 9ed923b..df55789 100644 --- a/brain/data/Render.php +++ b/brain/data/Render.php @@ -136,6 +136,7 @@ class Render 'archives' => $archive, 'info' => $this->pageInfo, 'menu' => $this->menu, + 'media' => [['file' => $this->pageInfo['image'], 'type' => trim(pathinfo($this->pageInfo['image'], PATHINFO_EXTENSION))]], ]; $html = $this->twig->render($template, $pageOptions); @@ -154,6 +155,7 @@ class Render 'tag_list' => $item['pages'], 'info' => $this->pageInfo, 'menu' => $this->menu, + 'media' => [['file' => $this->pageInfo['image'], 'type' => trim(pathinfo($this->pageInfo['image'], PATHINFO_EXTENSION))]], ]; $html = $this->twig->render($template, $pageOptions);