mirror of
https://gitlab.com/Titan-C/org-cv.git
synced 2024-11-21 13:38:35 +00:00
hugo export skipping empty entries
This commit is contained in:
parent
210d9c2720
commit
5109cbf0c8
2 changed files with 23 additions and 11 deletions
|
@ -54,7 +54,7 @@ If both dates are the same, return just FROM-DATE"
|
|||
(org-cv-utils-org-timestamp-to-shortdate to-date))))
|
||||
|
||||
(if from
|
||||
(if (string= from to)
|
||||
(if (or (string= from to) (string-equal-ignore-case to "skip"))
|
||||
from
|
||||
(concat from " -- " to))
|
||||
"")))
|
||||
|
|
28
ox-hugocv.el
28
ox-hugocv.el
|
@ -29,6 +29,7 @@
|
|||
|
||||
;;; Code:
|
||||
(require 'ox-hugo)
|
||||
(require 'dash)
|
||||
(require 'org-cv-utils)
|
||||
|
||||
;;; User-Configurable Variables
|
||||
|
@ -54,6 +55,20 @@
|
|||
)
|
||||
:translate-alist '((headline . org-hugocv-headline)))
|
||||
|
||||
(defun org-hugocv--entry-with-icon (field entry)
|
||||
"HTML entry for given FIELD when it is specified in ENTRY."
|
||||
(cl-ecase field
|
||||
(employer
|
||||
(-some->> (alist-get 'employer entry)
|
||||
(format "<i class=\"fa fa-building\"></i>%s<br/>")))
|
||||
(date
|
||||
(-some->>
|
||||
(org-cv-utils--format-time-window (alist-get 'from-date entry) (alist-get 'to-date entry))
|
||||
(format "<i class=\"fa fa-calendar\"></i>%s")))
|
||||
(location
|
||||
(-some->> (alist-get 'location entry)
|
||||
(org-string-nw-p)
|
||||
(format "<i class=\"fa fa-map-marker\"></i>%s")))))
|
||||
|
||||
(defun org-hugocv--format-cventry (headline contents info)
|
||||
"Format HEADLINE as as cventry.
|
||||
|
@ -66,17 +81,14 @@ as a communication channel."
|
|||
(format "<div class=\"cv-entry\">
|
||||
\n%s
|
||||
|
||||
<i class=\"fa fa-building\"></i>%s<br/>
|
||||
<i class=\"fa fa-calendar\"></i>%s
|
||||
<i class=\"fa fa-map-marker\"></i>%s
|
||||
%s
|
||||
|
||||
%s
|
||||
|
||||
</div>
|
||||
" title
|
||||
(alist-get 'employer entry)
|
||||
(org-cv-utils--format-time-window (alist-get 'from-date entry) (alist-get 'to-date entry))
|
||||
(alist-get 'location entry)
|
||||
</div>" title
|
||||
(mapconcat (lambda (field) (org-hugocv--entry-with-icon field entry))
|
||||
'(employer date location)
|
||||
"\n")
|
||||
contents)))
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue