(with-current-buffer (find-file-noselect (expand-file-name "index.org" dir))
(org-update-all-dblocks))))
+(defun esy/publish-add-canonical-tags (_plist)
+ (dolist (file (directory-files-recursively esy/publish-out-directory
+ (rx ".html" eos)))
+ (with-current-buffer (find-file-noselect file)
+ (when (search-forward "<!-- insert canonical tag here -->" nil t)
+ (replace-match (format "<link rel=\"canonical\" href=\"%s\" />"
+ (concat "https://eshelyaron.com/"
+ (file-relative-name file esy/publish-out-directory)))
+ nil t))
+ (basic-save-buffer))))
+
(defun esy/publish-completion-function (plist)
+ (esy/publish-add-canonical-tags plist)
(esy/publish-posts plist)
(esy/publish-sitemap plist))
:html-head (esy/dom-to-string '(link ((rel . "stylesheet")
(href . "/style.css")
(type . "text/css"))))
- :html-head-extra (esy/dom-to-string '(link ((rel . "alternate")
- (href . "/rss.xml")
- (type . "application/rss+xml")
- (title . "RSS feed of eshelyaron.com"))))
+ :html-head-extra (concat (esy/dom-to-string
+ '(link ((rel . "alternate")
+ (href . "/rss.xml")
+ (type . "application/rss+xml")
+ (title . "RSS feed of eshelyaron.com"))))
+ "\n<!-- insert canonical tag here -->")
:html-preamble-format
(list
(list