From de9bfcb3f3da90441bfe479f808a8eea6db607e1 Mon Sep 17 00:00:00 2001 From: maride Date: Wed, 28 Jan 2026 14:11:41 +0100 Subject: [PATCH] Add metadata to PDF (author, title, date) --- main.typ | 11 +++++++++-- pages/cover.typ | 4 ++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/main.typ b/main.typ index 3deac15..b5e2a50 100644 --- a/main.typ +++ b/main.typ @@ -10,8 +10,15 @@ #let targetFull = placeholder("Ellingson Mineral Corporation") #let targetInSentence = placeholder("Ellingston Mineral") #let reportType = placeholder("Penetration Test Report") +#let creationDate = datetime.today() -// Styling setup +// Document setup +#set document( + title: [#reportType #targetFull], + author: if type(author) == str { author } else { () }, + date: creationDate +) +// Page & styling setup #set text(font: "Helvetica Neue") #show heading: it => { v(1em) @@ -37,7 +44,7 @@ ) // ----- Cover & Legal disclaimer(s) ----- -#pages.cover.render(targetFull, place, author, reportType, +#pages.cover.render(targetFull, place, author, creationDate, reportType, confidential: false, // set to true for a "CONFIDENTIAL" mark on the cover tlp: "amber+strict", // set to one of "RED", "AMBER+STRICT", "AMBER", "GREEN", "CLEAR", or none. See https://www.first.org/tlp/ draft: true // set to true for a "DRAFT" mark on the cover diff --git a/pages/cover.typ b/pages/cover.typ index 984a523..3a0f370 100644 --- a/pages/cover.typ +++ b/pages/cover.typ @@ -1,6 +1,6 @@ #import "marks.typ" -#let render(title, place, author, reportType, confidential: false, tlp: none, draft: false) = { +#let render(title, place, author, date, reportType, confidential: false, tlp: none, draft: false) = { // Define page set page( background: [ @@ -21,7 +21,7 @@ v(0.25pt) text(size: 16pt, [ - #place, #datetime.today().display("[day].[month].[year]") + #place, #date.display("[day].[month].[year]") #author ])