(pubDate nil ,(substring file 0 10))
(description nil ,(format "<![CDATA[%s]]>" (esy/dom-to-string (car (dom-by-id dom "content")))))))))
+(defun esy/publish-file-url (file)
+ (concat "https://eshelyaron.com/"
+ (let ((path (file-relative-name file esy/publish-out-directory)))
+ (if (string= (file-name-base file) "index")
+ (file-name-directory path)
+ path))))
+
(defun esy/publish-sitemap (plist)
- (let ((locs (mapcar (lambda (file)
- (concat "https://eshelyaron.com/"
- (file-relative-name file esy/publish-out-directory)))
+ (let ((locs (mapcar #'esy/publish-file-url
(directory-files-recursively esy/publish-out-directory
(rx ".html" eos)))))
(with-temp-buffer
(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)))
+ (esy/publish-file-url file))
nil t))
(basic-save-buffer))))