diff options
Diffstat (limited to 'lib.typ')
-rw-r--r-- | lib.typ | 111 |
1 files changed, 111 insertions, 0 deletions
@@ -0,0 +1,111 @@ +#import "@preview/fontawesome:0.1.0": * + +#let left_column_size = 15% +#let grid_column_gutter = 10pt + +#let color-darknight = rgb("#131A28") +#let color-darkgray = rgb("#333333") +#let color-gray = rgb("#5d5d5d") +#let color-blue = rgb("#262F99") +#let svg-sourcehut = ```<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200z"></path></svg>```.text + +#let linkedin-icon = box() + +#let header(contact) = align(right + top)[ + #set block(below: 0.5em) + #set text(0.90em, style: "italic", fill: color-darkgray) + + #fa-phone() #link("tel:" + contact.phone, contact.phone) + + #fa-envelope() #link("mailto:" + contact.email) + + #fa-globe() #link("https://" + contact.website, contact.website) + + #fa-linkedin() #link( + "https://linkedin.com/in/" + contact.linkedin, + contact.linkedin, + ) + + #fa-github() #link("https://github.com/" + contact.github, contact.github) + + #box(height: 0.9em, image.decode(svg-sourcehut)) #link( + "https://sr.ht/" + contact.sourcehut, + contact.sourcehut, + ) +] + +#let resume(config, body) = { + set document(author: config.author.name, title: "resume") + set page(numbering: none) + set text(font: config.font, lang: config.lang, fallback: true) + set list( + marker: box( + circle(radius: 0.2em, stroke: rgb(config.color)), + inset: (top: 0.15em), + ), + ) + set enum(numbering: n => text(fill: rgb(config.color), [#n.])) + set par(justify: true, leading: 0.5em) + + grid( + columns: (1fr, 1fr), + box[ + #text(config.author.name, weight: 400, 2.5em) + #v(-1.2em) + #block( + text( + config.author.title, + weight: 400, + style: "italic", + fill: gray, + 1.5em, + ), + ) + ], + header(config.contact), + ) + + show heading.where(level: 1): element => [ + #v(0em) + #box( + inset: (right: grid_column_gutter, bottom: 0.1em), + rect(fill: rgb(config.color), width: left_column_size, height: 0.25em), + ) + #text(element.body, fill: rgb(config.color), weight: 400) + ] + + show heading.where(level: 2): element => [ + #grid( + columns: (left_column_size, auto), + row-gutter: 0.5em, + column-gutter: grid_column_gutter, + )[][ + #text(element.body, fill: rgb(config.color), weight: 400) + ] + ] + + body +} + +#let cover_letter( + author: (:), + date: datetime.today().display("[month repr:long] [day], [year]"), + title: "", + phone: "", + email: "", + github: "", + color: color-blue, + body, +) = { + header(phone: phone, email: email, github: github) +} + +#let cventry(label: [], title: [], subtitle: [], description) = grid( + columns: (left_column_size, auto), + row-gutter: 2em, + column-gutter: grid_column_gutter, +)[#align(right, label)][ + #text(title + if title != [] [,], size: 1em, weight: 800) + #text(subtitle, size: 1em, weight: 400, style: "italic") + #description +] |