diff options
Diffstat (limited to 'ennu-html.el')
-rw-r--r-- | ennu-html.el | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/ennu-html.el b/ennu-html.el index b1cf217..d87a598 100644 --- a/ennu-html.el +++ b/ennu-html.el @@ -295,6 +295,10 @@ ;; Pass other link types to org-html-link (_ (org-html-link link desc info))))) +(defmacro ennu-follow (path) + `(ennu-with-current-directory (ennu-setting :working-directory) + (find-file ,path))) + ;; TODO: Pass title through org-export-data-with-backend or something ;; similar in order to export org syntax in title (defun ennu-export-post (path desc backend) @@ -303,10 +307,20 @@ (xmlgen `(a :href ,(expand-file-name* path (ennu-setting :posts-directory)) ,(or desc (ennu-post-title (ennu-read-post filename))))))) +(defun ennu-follow-post (path) + (ennu-follow (expand-file-name (concat path ".org") + (ennu-setting :posts-directory)))) (org-link-set-parameters - "post" :export 'ennu-export-post) + "post" + :export 'ennu-export-post + :follow 'ennu-follow-post) + +(defun ennu-follow-image (path) + (ennu-follow (expand-file-name path (ennu-setting :images-directory)))) +(org-link-set-parameters + "image" :follow 'ennu-follow-image) (defun ennu-export-thumbnail (path desc backend) (xmlgen @@ -316,7 +330,9 @@ (ennu-setting :images-directory))))) (org-link-set-parameters - "thumbnail" :export 'ennu-export-thumbnail) + "thumbnail" + :export 'ennu-export-thumbnail + :follow 'ennu-follow-image) (defun ennu-export-video (path desc backend) (let ((video-directory (ennu-setting :video-directory))) |