aboutsummaryrefslogtreecommitdiff
path: root/ennu-html.el
diff options
context:
space:
mode:
Diffstat (limited to 'ennu-html.el')
-rw-r--r--ennu-html.el55
1 files changed, 33 insertions, 22 deletions
diff --git a/ennu-html.el b/ennu-html.el
index d87a598..4378d2a 100644
--- a/ennu-html.el
+++ b/ennu-html.el
@@ -302,11 +302,14 @@
;; 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)
- (let ((filename (concat (expand-file-name path (ennu-setting :posts-directory))
- ".org")))
- (xmlgen `(a :href ,(expand-file-name*
- path (ennu-setting :posts-directory))
- ,(or desc (ennu-post-title (ennu-read-post filename)))))))
+ (pcase backend
+ ((or 'ennu-html 'html)
+ (let ((filename (concat (expand-file-name path (ennu-setting :posts-directory))
+ ".org")))
+ (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))))
@@ -323,11 +326,13 @@
"image" :follow 'ennu-follow-image)
(defun ennu-export-thumbnail (path desc backend)
- (xmlgen
- `(img :src ,(expand-file-name*
- (ennu-image-output-filename
- path (ennu-setting :thumbnail-image-width))
- (ennu-setting :images-directory)))))
+ (pcase backend
+ ((or 'ennu-html 'html)
+ (xmlgen
+ `(img :src ,(expand-file-name*
+ (ennu-image-output-filename
+ path (ennu-setting :thumbnail-image-width))
+ (ennu-setting :images-directory)))))))
(org-link-set-parameters
"thumbnail"
@@ -335,20 +340,24 @@
:follow 'ennu-follow-image)
(defun ennu-export-video (path desc backend)
- (let ((video-directory (ennu-setting :video-directory)))
- (xmlgen
- `(video :src ,(expand-file-name* path video-directory)
- :poster ,(expand-file-name* (ennu-video-poster path) video-directory)
- :preload "none"
- :controls ""))))
+ (pcase backend
+ ((or 'ennu-html 'html)
+ (let ((video-directory (ennu-setting :video-directory)))
+ (xmlgen
+ `(video :src ,(expand-file-name* path video-directory)
+ :poster ,(expand-file-name* (ennu-video-poster path) video-directory)
+ :preload "none"
+ :controls ""))))))
(org-link-set-parameters
"video" :export 'ennu-export-video)
(defun ennu-export-static (path desc backend)
- (xmlgen
- `(a :href ,(expand-file-name* path (ennu-setting :static-directory))
- ,desc)))
+ (pcase backend
+ ((or 'ennu-html 'html)
+ (xmlgen
+ `(a :href ,(expand-file-name* path (ennu-setting :static-directory))
+ ,desc)))))
(org-link-set-parameters
"static" :export 'ennu-export-static)
@@ -357,9 +366,11 @@
"tangle" :export 'ennu-export-static)
(defun ennu-export-tag (tag desc backend)
- (xmlgen
- `(a :href ,(expand-file-name* tag (ennu-setting :tag-directory))
- ,(or desc tag))))
+ (pcase backend
+ ((or 'ennu-html 'html)
+ (xmlgen
+ `(a :href ,(expand-file-name* tag (ennu-setting :tag-directory))
+ ,(or desc tag))))))
(org-link-set-parameters
"tag" :export 'ennu-export-tag)