I'm using moderncv
to write my CV and I'd like to use a shorthand link in the header of my CV. The command \httplink
has an optional argument to do this, but this argument is not passed to \homepage
.
How can I redefine \homepage
to pass the shorthand link as an optional argument to \httplink
in the \maketitle
command without messing everything up?
An example of what I was thinking of is
\documentclass[11pt,a4paper,sans]{moderncv}
\moderncvstyle{classic}
\moderncvcolor{blue}
\renewcommand*{\homepage}[2]{\def\@homepage[#1]{#2}}
\firstname{John}
\lastname{Doe}
\homepage[shorthand]{long link that I'd like to mask}
\begin{document}
\maketitle
\end{document}
Except that I don't if that is the proper way to redefine homepage
and this code doesn't redefine line 265 of moderncvclassic.sty
where, as far as I can tell the argument of homepage
is passed to httplink
.
Best Answer
You'll have to patch
\makecvtitle
after loading theclassic
style using something likeetoolbox
.I've done so below, replacing the
\httplink{\@homepage}
piece with a conditional based on whether you supplied a shorthand argument<desc>
or not through the updated\homepage[<desc>]{<URL>}
: