Ignore contact fields that are set to none (#16)

* Add optional contact info

Ignore contact fields that are set to none. 
Email is taken as the "priority" field which is most likely set and therefore doesn't have a separator field included. This could be either set to a different field or be replaced by a better function.

* Fix Expression error

---------

Co-authored-by: Paul T <developer.paul.123@gmail.com>
This commit is contained in:
Christoph Gross
2024-04-06 03:10:12 +02:00
committed by GitHub
parent 201f6f7657
commit bf1e3bd1f6
2 changed files with 41 additions and 25 deletions

64
lib.typ
View File

@@ -281,18 +281,26 @@
) )
#block[ #block[
#align(horizon)[ #align(horizon)[
#phone-icon #if author.phone != none [
#box[#text(author.phone)] #phone-icon
#separator #box[#text(author.phone)]
#email-icon #separator
#box[#link("mailto:" + author.email)[#author.email]] ]
#separator #if author.email != none [
#github-icon #email-icon
#box[#link("https://github.com/" + author.github)[#author.github]] #box[#link("mailto:" + author.email)[#author.email]]
#separator ]
#linkedin-icon #if author.github != none [
#box[ #separator
#link("https://www.linkedin.com/in/" + author.linkedin)[#author.firstname #author.lastname] #github-icon
#box[#link("https://github.com/" + author.github)[#author.github]]
]
#if author.linkedin != none [
#separator
#linkedin-icon
#box[
#link("https://www.linkedin.com/in/" + author.linkedin)[#author.firstname #author.lastname]
]
] ]
] ]
] ]
@@ -531,18 +539,26 @@
#stack( #stack(
dir: ltr, dir: ltr,
spacing: 0.5em, spacing: 0.5em,
phone-icon, if author.phone != none [
box[#text(author.phone)], #phone-icon
separator, #box[#text(author.phone)]
email-icon, #separator
box[#link("mailto:" + author.email)[#author.email]], ],
separator, if author.email != none [
github-icon, #email-icon
box[#link("https://github.com/" + author.github)[#author.github]], #box[#link("mailto:" + author.email)[#author.email]]
separator, ],
linkedin-icon, if author.github != none [
box[ #separator
#link("https://www.linkedin.com/in/" + author.linkedin)[#author.firstname #author.lastname] #github-icon
#box[#link("https://github.com/" + author.github)[#author.github]]
],
if author.linkedin != none [
#separator
#linkedin-icon
#box[
#link("https://www.linkedin.com/in/" + author.linkedin)[#author.firstname #author.lastname]
]
], ],
) )
] ]

View File

@@ -16,7 +16,7 @@
), ),
), ),
date: datetime.today().display(), date: datetime.today().display(),
colored-headers: true colored-headers: true,
) )
= Experience = Experience