feat: Add support for custom author entry (#124)

This commit is contained in:
Laith Rastanawi
2025-07-02 14:36:15 +02:00
committed by GitHub
parent 6e709397d8
commit 24ed5bef9f
3 changed files with 52 additions and 2 deletions

38
lib.typ
View File

@@ -378,6 +378,23 @@
#website-icon
#box[#link(author.website)[#author.website]]
]
#if ("custom" in author and type(author.custom) == array) [
#for item in author.custom [
#if ("text" in item) [
#separator
#if ("icon" in item) [
#box(fa-icon(item.icon, fill: color-darknight))
]
#box[
#if ("link" in item) [
#link(item.link)[#item.text]
] else [
#item.text
]
]
]
]
]
]
]
]
@@ -549,7 +566,7 @@
/// Cover letter template that is inspired by the Awesome CV Latex template by posquit0. This template can loosely be considered a port of the original Latex template.
/// This coverletter template is designed to be used with the resume template.
/// - author (content): Structure that takes in all the author's information. The following fields are required: firstname, lastname, positions. The following fields are used if available: email, phone, github, linkedin, orcid, address, website.
/// - author (content): Structure that takes in all the author's information. The following fields are required: firstname, lastname, positions. The following fields are used if available: email, phone, github, linkedin, orcid, address, website, custom. The `custom` field is an array of additional entries with the following fields: text (string, required), icon (string, optional Font Awesome icon name), link (string, optional).
/// - profile-picture (image): The profile picture of the author. This will be cropped to a circle and should be square in nature.
/// - date (datetime): The date the cover letter was created. This will default to the current date.
/// - accent-color (color): The accent color of the cover letter
@@ -716,6 +733,25 @@
]
}
if ("custom" in author and type(author.custom) == array) {
for item in author.custom {
if ("text" in item) {
author_list.push[
#if ("icon" in item) [
#box(fa-icon(item.icon, fill: color-darknight))
]
#box[
#if ("link" in item) [
#link(item.link)[#item.text]
] else [
#item.text
]
]
]
}
}
}
align(right)[
#set text(size: 8pt, weight: "light", style: "normal")

View File

@@ -14,6 +14,13 @@
"Software Engineer",
"Full Stack Developer",
),
custom: (
(
text: "Youtube Channel",
icon: "youtube",
link: "http://example.com",
),
),
),
profile-picture: none,
language: "sp",

View File

@@ -19,6 +19,13 @@
"Software Architect",
"Developer",
),
custom: (
(
text: "Youtube Channel",
icon: "youtube",
link: "https://example.com",
),
),
),
profile-picture: image("profile.png"),
date: datetime.today().display(),