Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds an org-static-blog-after-publish hook #141

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions org-static-blog.el
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,11 @@ Only if og tags are enabled. It can be overridden with the
:type '(string)
:safe t)

(defcustom org-static-blog-after-publish-hook nil
"Hook run after org-static-blog-publish."
:type 'hook
:safe t)

;; localization support
(defconst org-static-blog-texts
'((other-posts
Expand Down Expand Up @@ -427,6 +432,11 @@ re-rendered.
With a prefix argument, all blog posts are re-rendered
unconditionally."
(interactive "P")
(org-static-blog-publish-blog force-render)
(run-hooks 'org-static-blog-after-publish-hook))

(defun org-static-blog-publish-blog (force-render)
"Renders the blog before \='org-static-blog-after-publish-hook\='."
(dolist (file (append (org-static-blog-get-post-filenames)
(org-static-blog-get-draft-filenames)))
(when (or force-render (org-static-blog-needs-publishing-p file))
Expand Down