Skip to content

Commit

Permalink
op/generate-uri support %f
Browse files Browse the repository at this point in the history
  • Loading branch information
jixiuf committed Feb 3, 2017
1 parent bef1e2f commit db580d9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions op-export.el
Original file line number Diff line number Diff line change
Expand Up @@ -200,19 +200,23 @@ can contain following parameters:
%y: year of creation date
%m: month of creation date
%d: day of creation date
%f: base file name with suffix .html (a.org->a.html)
%t: title of current buffer"
(let ((uri-template (or (op/read-org-option "URI")
default-uri-template))
(date-list (split-string (if creation-date
(fix-timestamp-string creation-date)
(format-time-string "%Y-%m-%d"))
"-"))
(html-file-name (concat (file-name-base (buffer-file-name)) ".html"))
(encoded-title (encode-string-to-url title)))
(format-spec uri-template `((?y . ,(car date-list))
(?m . ,(cadr date-list))
(?d . ,(cl-caddr date-list))
(?f . ,html-file-name)
(?t . ,encoded-title)))))


(defun op/get-file-category (org-file)
"Get org file category presented by ORG-FILE, return all categories if
ORG-FILE is nil. This is the default function used to get a file's category,
Expand Down

0 comments on commit db580d9

Please sign in to comment.