cv/layout.typ
2026-03-20 09:52:09 +00:00

163 lines
3.3 KiB
Text

#let icon(name, shift: 0.25em) = {
box(
baseline: shift,
height: 1.25em,
image("icons/" + name + ".svg", alt: name)
)
h(0.35em)
}
#let cv(
name: "",
tagline: "",
links: (),
paper: "a4",
accent: rgb("#870c66"),
heading_font: "Inter",
body_font: "Inter",
mono_font: "TX-02",
doc,
) = {
set text(size: 9pt, font: body_font, weight: "medium")
set page(paper, margin: (x: 0.8cm, y: 0.8cm))
set par(justify: true)
show raw: it => text(size: 1.2em, font: mono_font, baseline: -0.05em)[#it]
show heading.where(level: 1): it => text(
size: 1.6em,
font: heading_font,
tracking: 0.1pt,
weight: "semibold",
block[
#{it.body}
]
)
show heading.where(level: 2): it => text(
fill: accent,
font: heading_font,
tracking: 0.1pt,
weight: "bold",
size: 1.35em,
[
#{it.body}
#v(-0.85em)
#line(length: 100%, stroke: 1pt + accent)
#v(0.2em)
]
)
show heading.where(level: 3): it => text(
size: 1.2em,
weight: "semibold",
block[#it]
)
[
#grid(
columns: (1fr, 1fr),
gutter: 1em,
{
[= #name]
text(
font: body_font,
size: 1em,
block[#{tagline}]
)
},
[
#box[
#h(4em)
#grid(
columns: 2,
gutter: 0.75em,
..links.map(l => {
[#h(2em)]
link(l.link)[
#set text(weight: "medium")
#icon(l.icon)
#if "text" in l.keys() { l.text } else { l.link }
]
})
)
]
]
)
]
doc
}
#let divider(accent: rgb("#870c66")) = {
v(-0.25em)
line(length: 100%, stroke: (paint: accent, thickness: 1pt, dash: "dotted"))
v(-0.25em)
}
#let event(
accent: rgb("#870c66"), company_newline: false,
title, company, period, location
) = [
#if company_newline {
grid(
columns: (auto, 1fr),
align: (left + bottom, right + bottom),
box[
#text(1.2em, weight: "semibold")[#title]\
#text(0.96em, fill: accent, weight: "bold")[_#[#company]_]
],
box[
#if period != [] {
icon("calendar", shift: 0.18em)
[_#[#period]_]
}\
#if location != [] {
icon("location")
location
}
]
)
} else {
grid(
columns: (1fr, auto),
align: (left + top, right + top),
box(text(1.2em, weight: "semibold")[#title]),
box(text(0.96em, fill: accent, weight: "bold")[_#[#company]_])
)
v(-0.5em)
if period != [] {
icon("calendar", shift: 0.18em)
[_#[#period]_]
}
h(1fr)
if location != [] {
icon("location")
location
}
}
]
#let article(
accent: rgb("#870c66"),
title: "", date: "", url: ""
) = [
#par(justify: false)[
#text(weight: "semibold")[
#text(size: 1.2em)["#title"]
]\
#text(size: 0.85em, style: "italic", weight: "semibold", tracking: -0.025em)[
#icon("calendar", shift: 0.15em)
#h(0.1em)
#date
]
#h(0.75em)
#text(size: 0.85em, style: "italic", weight: "bold", tracking: -0.025em, fill: accent)[
#icon("link", shift: 0.25em)
#h(-0.25em)
#link("https://" + url)[#url]
]
]
]