seperating build
This commit is contained in:
@@ -351,59 +351,6 @@ CATEGORIES-REL is the relative href to categories.html."
|
||||
"\n")
|
||||
"_No tags found yet._")))))
|
||||
|
||||
;; ─────────────────────────────────────────────────────────────────────────────
|
||||
;; WIP sitemap
|
||||
;; ─────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
(defun z/wip-file-p (file)
|
||||
"Return non-nil if FILE is marked as work-in-progress.
|
||||
|
||||
A file is WIP when any of the following is true:
|
||||
- It has a #+WIP: keyword with a non-empty value.
|
||||
- Its FILETAGS contain :WIP:.
|
||||
- Any top-level heading contains \"WIP\" (case-insensitive)."
|
||||
(when (file-exists-p file)
|
||||
(with-temp-buffer
|
||||
(insert-file-contents file)
|
||||
(org-mode)
|
||||
(let* ((case-fold-search t)
|
||||
(keywords (org-collect-keywords '("WIP" "FILETAGS")))
|
||||
(wip (cadr (assoc "WIP" keywords)))
|
||||
(filetags (cadr (assoc "FILETAGS" keywords))))
|
||||
(or
|
||||
(and wip (string-match-p "\\S-" wip))
|
||||
(and filetags (string-match-p ":WIP:" (concat ":" filetags ":")))
|
||||
(save-excursion
|
||||
(goto-char (point-min))
|
||||
(re-search-forward "^\\*+ .*WIP.*" nil t)))))))
|
||||
|
||||
(defun z/wip-sitemap (title list)
|
||||
"Sitemap listing only entries whose source files are marked WIP."
|
||||
(let ((items
|
||||
(delq nil
|
||||
(mapcar
|
||||
(lambda (entry)
|
||||
(when (consp entry)
|
||||
(let* ((link (car entry))
|
||||
(filename (if (string-match "\\[\\[file:\\([^]]+\\)\\]" link)
|
||||
(match-string 1 link)
|
||||
link))
|
||||
(full-path (expand-file-name filename z/site-root)))
|
||||
(when (z/wip-file-p full-path)
|
||||
(let* ((date (org-publish-find-date full-path org-publish-project-alist))
|
||||
(date-str (if date
|
||||
(format-time-string "%d-%m-%Y %H:%M" date)
|
||||
"")))
|
||||
(format "- %s @@html:<span class=\"post-date\">%s</span>@@"
|
||||
link date-str))))))
|
||||
(cdr list)))))
|
||||
(concat "#+TITLE: " title "\n"
|
||||
"#+OPTIONS: toc:nil num:nil\n\n"
|
||||
"* Work in progress\n"
|
||||
(if items
|
||||
(mapconcat #'identity items "\n")
|
||||
"No items currently marked as WIP.\n"))))
|
||||
|
||||
(provide 'sitemaps)
|
||||
|
||||
;;; sitemaps.el ends here
|
||||
|
||||
Reference in New Issue
Block a user