A dedicated blog instance for links

I decided to separate normal posts and links posts into two separate blog instances: blog and linkage.

Managing multiple blog instances with org-static-blog

By itself, org-static-blog does not support multiple blog instances, but it's quite easy to obtain a similar feature.

(defvar +my-blogs+
  '((blog . ((org-static-blog-publish-title . "Stefano Rodighiero — Stream")
             (org-static-blog-publish-url . "https://stefanorodighiero.net/blog/")
             ;; ... and so on ...
             ))
    (linkage . ((org-static-blog-publish-title . "Stefano Rodighiero — Linkage")
                (org-static-blog-publish-url . "https://stefanorodighiero.net/linkage/")
                ;; ... and so on ...
                ))))

(defun select-active-blog (blog-name)
  (interactive (list (intern (completing-read "Select active blog for publication: "
                                              (mapcar #'car +my-blogs+)))))
  (let ((blog-options (cdr (assoc blog-name +my-blogs+))))
    (message "Setting active blog: %s" blog-name)
    (dolist (option-name (mapcar #'car blog-options))
      (set option-name (cdr (assoc option-name blog-options))))))

Then org-static-blog functions can be advised so that select-active-blog is called before the operations.

(advice-add 'org-static-blog-publish :before (lambda (&rest args)
                                               (call-interactively 'select-active-blog)))