fix(template): fix the display of location and date

- extra space
- without the location, the comma still appeared
- docs(readme): add the optional comment for the sending location
This commit is contained in:
Fabrice Mouhartem 2024-10-20 11:23:04 +02:00
parent be06465111
commit 9af1dcb98b
Signed by: fmouhart
GPG Key ID: 2C5033B228CFE4E7
3 changed files with 13 additions and 3 deletions

Binary file not shown.

View File

@ -17,13 +17,23 @@
show raw: set text(font: "Inconsolata") show raw: set text(font: "Inconsolata")
show heading: set block(above: 1.4em, below: 1em) show heading: set block(above: 1.4em, below: 1em)
let formatLieuDate(lieu, date) = {
let isDate = date.trim().len() > 0;
let isLieu = lieu.trim().len() > 0;
if isLieu [#lieu]
else []
if isDate {
if isLieu [, ]
[le #date]
}
}
grid( grid(
columns: (2fr, 1fr, 2fr), columns: (2fr, 1fr, 2fr),
par(de), par(de),
text[], text[],
text[ text[
#lieu #formatLieuDate(lieu, date)
#if date.trim().len() != 0 [, le #date ]
] + v(2em), ] + v(2em),
text[], text[],
text[], text[],

View File

@ -19,7 +19,7 @@ parameters, with the [`lettre.typ`](./lettre.typ) file in the same folder:
], ],
objet: "subject of the letter", // optional objet: "subject of the letter", // optional
date: "date of sending", // optional date: "date of sending", // optional
lieu: "location", lieu: "location", // optional
introduction: "opening", introduction: "opening",
cloture: "closing", cloture: "closing",
signature: "signature", signature: "signature",