Skip to content

Commit

Permalink
Merge pull request #111 from hellwolf/patch-1
Browse files Browse the repository at this point in the history
use file-truename in get-post-public-path
  • Loading branch information
bastibe committed Oct 18, 2022
2 parents a6cd8f6 + c646174 commit bebd826
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions org-static-blog.el
Expand Up @@ -592,17 +592,17 @@ published HTML version of the post."

(defun org-static-blog-get-post-public-path (post-filename)
"Returns post filepath in public directory.
This function retrieves relative path to the post file in posts or drafts
directories, the date of the post from its contents and then passes it to
`org-static-blog-generate-post-path` to generate custom filepath for the published
HTML version of the post."
(let ((root-dir
(if (string-prefix-p (file-truename org-static-blog-posts-directory)
(file-truename post-filename))
org-static-blog-posts-directory
org-static-blog-drafts-directory)))
(concat (file-name-sans-extension (file-relative-name post-filename root-dir)) ".html")))
This function retrieves relative path to the post file in posts
or drafts directories, the date of the post from its contents and
then passes it to `org-static-blog-generate-post-path` to
generate custom filepath for the published HTML version of the
post."
(let* ((true-post-filename (file-truename post-filename))
(true-posts-directory (file-truename org-static-blog-posts-directory))
(root-dir (if (string-prefix-p true-posts-directory true-post-filename)
true-posts-directory
(file-truename org-static-blog-drafts-directory))))
(concat (file-name-sans-extension (file-relative-name true-post-filename root-dir)) ".html"))))

(defun org-static-blog-get-relative-path (post-filename)
"Removes absolute directory path from POST-FILENAME and changes file extention
Expand Down

0 comments on commit bebd826

Please sign in to comment.