From 72c4d72bc6cbcea23e237e92ae19a07ee83d5944 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Tue, 23 Aug 2022 15:30:46 +0200 Subject: Fixed related layout --- scripts/page.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'scripts/page.lua') diff --git a/scripts/page.lua b/scripts/page.lua index 48eef6e..33982ba 100644 --- a/scripts/page.lua +++ b/scripts/page.lua @@ -149,9 +149,12 @@ function generate_related(meta) if not meta.prev and not meta.next then return nil end - local layout = meta.parent.list_layout - local layout_id = utils.stringify(layout.id) - if layout_id ~= "grid-2" and layout_id ~= "gallery-2" then + local layout + local layout_id = utils.stringify(meta.parent.list_layout.id) + + if layout_id == "gallery-2" or layout_id == "gallery-3" then + layout = common.prep_layout("gallery-2") + else layout = common.prep_layout("grid-2") end -- cgit v1.2.3-54-g00ecf