From 93f0a3010966fb75d5770d113951a38e59069b6d Mon Sep 17 00:00:00 2001 From: servostar Date: Sun, 1 Dec 2024 11:44:54 +0000 Subject: [PATCH] fix: hide empty author information (#119) Reviewed-on: https://git.montehaselino.de/DHBW/dhbw-abb-typst-template/pulls/119 Release-As: v0.6.2 Co-authored-by: servostar Co-committed-by: servostar --- src/pages/titlepage.typ | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/pages/titlepage.typ b/src/pages/titlepage.typ index faa8d19..eae556a 100644 --- a/src/pages/titlepage.typ +++ b/src/pages/titlepage.typ @@ -107,17 +107,21 @@ grid(columns: cols, column-gutter: 1.5em, ..config .authors .slice(i * 3, i * 3 + cols) - .map(author => grid( - columns: 1, - row-gutter: 1em, - text(size: 1.25em, author.name), - text(size: 1em, author.company), - text(size: 1em, author.contact), - [ - #str(author.matriculation-number), - #author.course - ], - ))) + .map(author => par([ + #if author.at("name", default: none) != none { + text(size: 1.25em, author.name) + linebreak() + } + #if author.at("company", default: none) != none { + text(size: 1em, author.company) + linebreak() + } + #if author.at("contact", default: none) != none { + text(size: 1em, author.contact) + linebreak() + } + #str(author.matriculation-number), #author.course + ]))) } ]