aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lisp/seam-export.el2
-rw-r--r--lisp/seam.el14
2 files changed, 10 insertions, 6 deletions
diff --git a/lisp/seam-export.el b/lisp/seam-export.el
index 71a7921..b5d7046 100644
--- a/lisp/seam-export.el
+++ b/lisp/seam-export.el
@@ -239,7 +239,7 @@ notes)."
(defun seam-export--note-to-html (note-file html-directory)
(seam-ensure-directory-exists html-directory)
(let ((html-file (file-name-concat html-directory
- (concat (file-name-base note-file) ".html")))
+ (concat (seam-get-slug-from-file-name note-file) ".html")))
(modified (file-attribute-modification-time
(file-attributes note-file))))
(with-temp-buffer
diff --git a/lisp/seam.el b/lisp/seam.el
index 2824fc7..a5b0b0d 100644
--- a/lisp/seam.el
+++ b/lisp/seam.el
@@ -172,6 +172,9 @@ naming. Must be a function taking two arguments: TITLE and TYPE."
(insert-file-contents file)
(seam-get-title-from-buffer)))
+(defun seam-get-slug-from-file-name (file)
+ (string-remove-prefix "-" (file-name-base file)))
+
(cl-defun seam-get-slug-from-buffer (&optional (buffer (current-buffer)))
(or (with-current-buffer buffer
(save-mark-and-excursion
@@ -295,11 +298,12 @@ completion prompt is given to choose the type."
(seam-get-links-from-buffer)))
(defun seam-delete-html-files-for-note (note-file)
- (dolist (dir (seam-html-directories))
- (let ((html (file-name-concat dir (concat (file-name-base note-file) ".html"))))
- (when (file-exists-p html)
- (delete-file html)
- (message "Deleted %s" html)))))
+ (let ((html-nd (concat (seam-get-slug-from-file-name note-file) ".html")))
+ (dolist (dir (seam-html-directories))
+ (let ((html (file-name-concat dir html-nd)))
+ (when (file-exists-p html)
+ (delete-file html)
+ (message "Deleted %s" html))))))
(defun seam--rename-file (old new interactive)
(rename-file old new)