((* if design.show_last_updated_date *))
\placelastupdatedtext
((* endif *))

((* if cv.name is not none *))
{
    \centering
    \textbf{\fontsize{<<design.header_font_size>>}{<<design.header_font_size>>}\selectfont
        <<cv.name>>
    } \\ \vspace{3pt}
    \small

    \vspace{<<design.margins.header.vertical_between_name_and_connections>>}
    
    \begin{spacing}{1.6}
    ((* if cv.phone *))
    \mbox{\href{<<cv.phone|replace("-","")>>}{{\footnotesize\faPhone*}\hspace{4pt}<<cv.phone|replace("tel:", "")|replace("-"," ")>>}}
    \hspace{<<design.margins.header.horizontal_between_connections>>}
    ((* endif *))
    ((* if cv.email *))
    \mbox{\href{mailto:<<cv.email>>}{{\small\faEnvelope[regular]}\hspace{4pt}<<cv.email|escape_latex_characters>>}}
    \hspace{<<design.margins.header.horizontal_between_connections>>}
    ((* endif *))
    ((* if cv.location *))
    \mbox{{\small\faMapMarker*}\hspace{4pt}<<cv.location>>}
    \hspace{<<design.margins.header.horizontal_between_connections>>}
    ((* endif *))
    ((* if cv.website *))
    \mbox{\href{<<cv.website>>}{{\small\faLink}\hspace{4pt}<<cv.website|replace("https://","")|reverse|replace("/", "", 1)|reverse>>}}
    \hspace{<<design.margins.header.horizontal_between_connections>>}
    ((* endif *))
    ((*
        set icon_dictionary = {
            "LinkedIn": "\\faLinkedinIn",
            "GitHub": "\\faGithub",
            "Instagram": "\\faInstagram",
            "Mastodon": "\\faMastodon",
            "Orcid": "\\faOrcid",
        }
    *))
    ((* if cv.social_networks *))
        ((* for network in cv.social_networks *))
            ((* if network.network in icon_dictionary *))
    \mbox{\href{<<network.url>>}{{\small<<icon_dictionary[network.network]>>}\hspace{4pt}<<network.username>>}}
    \hspace*{<<design.margins.header.horizontal_between_connections>>}
            ((* endif *))
        ((* endfor *))
    ((* endif *))
    \end{spacing}
    \par
}

\vspace{<<design.margins.header.bottom>>}
((* endif *))

% save the original href command in a new command:
\let\hrefWithoutArrow\href
% new command for external links:
\renewcommand{\href}[2]{\hrefWithoutArrow{#1}{\color{primaryColor}\mbox{\ifthenelse{\equal{#2}{}}{}{#2 }\raisebox{.15ex}{\footnotesize \faExternalLink*}}}}