Skip to content

Commit

Permalink
Merge pull request #134 from alexispurslane/master
Browse files Browse the repository at this point in the history
Fix a bug when used with .dir-locals.el
  • Loading branch information
bastibe authored Jul 27, 2024
2 parents 62fe0a3 + 41e2c39 commit 34c9a60
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions org-static-blog.el
Original file line number Diff line number Diff line change
Expand Up @@ -617,26 +617,27 @@ Preamble and Postamble are excluded, too."
Preamble and Postamble are excluded, too."
;; NB! The following code assumes the post is using default template.
;; See: org-static-blog-publish-file
(with-temp-buffer
(insert-file-contents (org-static-blog-matching-publish-filename post-filename))
(buffer-substring-no-properties
(progn
(goto-char (point-min))
(if exclude-title
(progn (search-forward "<h1 class=\"post-title\">")
(search-forward "</h1>"))
(search-forward "<div id=\"content\">"))
(point))
(progn
(goto-char (point-max))
;; Search backward for the post content (by org-static-blog-render-post-content).
;; See: org-static-blog-template
(search-backward "<div id=\"postamble\" class=\"status\">")
(search-backward "</div>")
;; If comments section exists, it is then one div backward.
;; See: org-static-blog-post-postamble
(search-backward "<div id=\"comments\">" nil t)
(point)))))
(let ((publish-filename (org-static-blog-matching-publish-filename post-filename)))
(with-temp-buffer
(insert-file-contents publish-filename)
(buffer-substring-no-properties
(progn
(goto-char (point-min))
(if exclude-title
(progn (search-forward "<h1 class=\"post-title\">")
(search-forward "</h1>"))
(search-forward "<div id=\"content\">"))
(point))
(progn
(goto-char (point-max))
;; Search backward for the post content (by org-static-blog-render-post-content).
;; See: org-static-blog-template
(search-backward "<div id=\"postamble\" class=\"status\">")
(search-backward "</div>")
;; If comments section exists, it is then one div backward.
;; See: org-static-blog-post-postamble
(search-backward "<div id=\"comments\">" nil t)
(point))))))

(defun org-static-blog-get-absolute-url (relative-url)
"Returns absolute URL based on the RELATIVE-URL passed to the function.
Expand Down

0 comments on commit 34c9a60

Please sign in to comment.