diff --git a/ox-hugocv.el b/ox-hugocv.el index 7f2ed52..a7224e1 100644 --- a/ox-hugocv.el +++ b/ox-hugocv.el @@ -52,20 +52,25 @@ :translate-alist '((headline . org-hugocv-headline) (inner-template . org-hugocv-inner-template))) -(defvar recognized-social-networks - '((:url "https://www.github.com" +(setq org-hugocv--recognized-social-networks + '((:url "https://www.github.com/" :icon "fa-github") - (:url "https://www.gitlab.com" + (:url "https://www.gitlab.com/" :icon "fa-gitlab") - (:url "https://www.linkedin.com/in" + (:url "https://www.linkedin.com/in/" :icon "fa-linkedin") - (:url "https://twitter.com" + (:url "https://twitter.com/" :icon "fa-twitter") - (:url "https://facebook.com" + (:url "https://facebook.com/" :icon "fa-facebook") - (:url "https://www.instagram.com" + (:url "https://www.instagram.com/" :icon "fa-instagram"))) +(defun org-hugocv--crop-edges (x) + "String is so remove first and last chars." + (let ((le (- (length x) 1))) + (substring x 1 le))) + (defun org-hugocv--format-cventry (headline contents info) "Format HEADLINE as as cventry. CONTENTS holds the contents of the headline. INFO is a plist used @@ -94,7 +99,7 @@ contents))) (let* ((nw-handle (string-trim handle)) (icon-wrap (if (org-string-nw-p icon) (format " %s" icon nw-handle) nw-handle))) - (format "%s" url nw-handle icon-wrap))) + (format "%s" url nw-handle icon-wrap))) (defun org-hugocv--unknown-social-channels (headline contents info) (let ((icon (org-export-data (org-element-property :ICON headline) info)) @@ -146,10 +151,11 @@ holding export options." (let ((email (and (plist-get info :with-email) (org-export-data (plist-get info :email) info)))) (when (org-string-nw-p email) - (format "
  • %s
  • \n" email email))) + (social-entry "fa-envelope" "mailto:" email))) ;; homepage - (let ((homepage (org-export-data (plist-get info :homepage) info))) - (when (org-string-nw-p homepage) (format "
  • %s
  • \n" homepage homepage))) + (let ((homepage (org-hugocv--crop-edges (org-export-data (plist-get info :homepage) info)))) + (when (org-string-nw-p homepage) + (social-entry "fa-globe" "" homepage))) "\n\n" (org-hugo-inner-template contents info)))