Skip to content

Commit

Permalink
Use https and fix underscore in moderncv template
Browse files Browse the repository at this point in the history
Resolves #117 using xdanaux/moderncv#77
  • Loading branch information
mitchelloharawild committed Jan 10, 2021
1 parent 17d512d commit d549098
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions inst/rmarkdown/templates/moderncv/skeleton/moderncv.cls
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,12 @@
\NewDocumentCommand{\social}{O{}O{}m}{%
\ifthenelse{\equal{#2}{}}%
{%
\ifthenelse{\equal{#1}{linkedin}}{\collectionadd[linkedin]{socials}{\protect\httplink[#3]{www.linkedin.com/in/#3}}} {}%
\ifthenelse{\equal{#1}{xing}} {\collectionadd[xing]{socials} {\protect\httplink[#3]{www.xing.com/profile/#3}}}{}%
\ifthenelse{\equal{#1}{twitter}} {\collectionadd[twitter]{socials} {\protect\httplink[#3]{www.twitter.com/#3}}} {}%
\ifthenelse{\equal{#1}{github}} {\collectionadd[github]{socials} {\protect\httplink[#3]{www.github.com/#3}}} {}%
\ifthenelse{\equal{#1}{gitlab}} {\collectionadd[gitlab]{socials} {\protect\httplink[#3]{www.gitlab.com/#3}}} {}%
\ifthenelse{\equal{#1}{skype}} {\collectionadd[skype]{socials} {#3}} {}%
\ifthenelse{\equal{#1}{linkedin}}{\collectionadd[linkedin]{socials}{\protect\httpslink[#3]{www.linkedin.com/in/#3}}} {}%
\ifthenelse{\equal{#1}{xing}} {\collectionadd[xing]{socials} {\protect\httpslink[#3]{www.xing.com/profile/#3}}}{}%
\ifthenelse{\equal{#1}{twitter}} {\collectionadd[twitter]{socials} {\protect\httpslink[#3]{www.twitter.com/#3}}} {}%
\ifthenelse{\equal{#1}{github}} {\collectionadd[github]{socials} {\protect\httpslink[#3]{www.github.com/#3}}} {}%
\ifthenelse{\equal{#1}{gitlab}} {\collectionadd[gitlab]{socials} {\protect\httpslink[#3]{www.gitlab.com/#3}}} {}%
\ifthenelse{\equal{#1}{skype}} {\collectionadd[skype]{socials} {#3}} {}%
}
{\collectionadd[#1]{socials}{\protect\httplink[#3]{#2}}}}

Expand Down Expand Up @@ -503,6 +503,23 @@
{\href{http://#2}{#2}}%
{\href{http://#2}{#1}}}

% makes a https hyperlink with escaped underscore in link name
% usage: \httpslink[optional text]{link}
\newcommand*{\httpslink}[2][]{%
\ifthenelse{\equal{#1}{}}%
{\href{https://#2}{\expandafter\escapeunderscore\expandafter{#2}}}
{\href{https://#2}{\expandafter\escapeunderscore\expandafter{#1}}}
}

\ExplSyntaxOn
\tl_new:N \l_escapeunderscore_tl
\cs_new:Npn \escapeunderscore #1 {
\tl_set:Nn \l_escapeunderscore_tl {#1}
\regex_replace_all:nnN {\_} {_} \l_escapeunderscore_tl
\tl_use:N \l_escapeunderscore_tl
}
\ExplSyntaxOff

% makes an email hyperlink
% usage: \emaillink[optional text]{link}
\newcommand*{\emaillink}[2][]{%
Expand Down

0 comments on commit d549098

Please sign in to comment.