major changes
This commit is contained in:
6
lisp/recently-updated.el
Normal file → Executable file
6
lisp/recently-updated.el
Normal file → Executable file
@@ -2,10 +2,12 @@
|
||||
|
||||
(require 'cl-lib)
|
||||
(require 'org)
|
||||
(defvar site-root
|
||||
(file-name-directory
|
||||
(or load-file-name buffer-file-name)))
|
||||
|
||||
(defvar z-org-root
|
||||
(file-name-as-directory
|
||||
(expand-file-name "~/master-folder/org_files/org_web"))
|
||||
(file-name-as-directory site-root)
|
||||
"Root directory of the Org source files.")
|
||||
|
||||
;; Which Org files should be skipped for Recently Updated
|
||||
|
||||
0
lisp/sidenotes.el
Normal file → Executable file
0
lisp/sidenotes.el
Normal file → Executable file
36
lisp/sitemaps.el
Normal file → Executable file
36
lisp/sitemaps.el
Normal file → Executable file
@@ -1,3 +1,10 @@
|
||||
(defvar site-root
|
||||
(file-name-directory
|
||||
(or load-file-name buffer-file-name)))
|
||||
|
||||
(defun site-path (path)
|
||||
(expand-file-name path site-root))
|
||||
|
||||
(defun z/posts-sitemap (title list)
|
||||
"sitemap that lists post links as bullet points with dates and tags."
|
||||
(concat
|
||||
@@ -12,7 +19,7 @@
|
||||
(filename (if (string-match "\\[\\[file:\\([^]]+\\)\\]" link)
|
||||
(match-string 1 link)
|
||||
link))
|
||||
(full-path (expand-file-name filename "~/master-folder/org_files/org_web/posts/"))
|
||||
(full-path (expand-file-name filename (site-path "posts/")))
|
||||
(date-str "no date")
|
||||
(tags-str ""))
|
||||
;; Get publish date
|
||||
@@ -50,7 +57,7 @@
|
||||
(filename (if (string-match "\\[\\[file:\\([^]]+\\)\\]" link)
|
||||
(match-string 1 link)
|
||||
link))
|
||||
(full-path (expand-file-name filename "~/master-folder/org_files/org_web/blogs/"))
|
||||
(full-path (expand-file-name filename (site-path "blogs/")))
|
||||
(date-str "no date")
|
||||
(tags-str ""))
|
||||
;; Get publish date
|
||||
@@ -88,7 +95,7 @@
|
||||
(filename (if (string-match "\\[\\[file:\\([^]]+\\)\\]" link)
|
||||
(match-string 1 link)
|
||||
link))
|
||||
(full-path (expand-file-name filename "~/master-folder/org_files/org_web/books/"))
|
||||
(full-path (expand-file-name filename (site-path "books/")))
|
||||
(date-str "no date")
|
||||
(tags-str ""))
|
||||
;; Get publish date
|
||||
@@ -129,9 +136,7 @@
|
||||
(filename (if (string-match "\\[\\[file:\\([^]]+\\)\\]" link)
|
||||
(match-string 1 link)
|
||||
link))
|
||||
(full-path (expand-file-name
|
||||
filename
|
||||
"~/master-folder/org_files/org_web/blogs/2025/"))
|
||||
(full-path (expand-file-name filename (site-path "blogs/2025/")))
|
||||
(date (when (file-exists-p full-path)
|
||||
(org-publish-find-date full-path org-publish-project-alist)))
|
||||
(date-str (if date
|
||||
@@ -186,9 +191,7 @@
|
||||
(filename (if (string-match "\\[\\[file:\\([^]]+\\)\\]" link)
|
||||
(match-string 1 link)
|
||||
link))
|
||||
(full-path (expand-file-name
|
||||
filename
|
||||
"~/master-folder/org_files/org_web/blogs/2026/"))
|
||||
(full-path (expand-file-name filename (site-path "blogs/2026/")))
|
||||
(date (when (file-exists-p full-path)
|
||||
(org-publish-find-date full-path org-publish-project-alist)))
|
||||
(date-str (if date
|
||||
@@ -233,7 +236,6 @@
|
||||
"#+TITLE: " title "\n"
|
||||
"#+OPTIONS: toc:nil num:nil \n\n"
|
||||
"See the categories: @@html:<a href=\"../../home/categories.html\">Categories</a>@@\n\n"
|
||||
"* 2025\n"
|
||||
"See the following page for more details: @@html:<a href=\"./career-intro.html\">Career Intro</a>@@\n"
|
||||
))
|
||||
(current-month nil))
|
||||
@@ -244,9 +246,7 @@
|
||||
(filename (if (string-match "\\[\\[file:\\([^]]+\\)\\]" link)
|
||||
(match-string 1 link)
|
||||
link))
|
||||
(full-path (expand-file-name
|
||||
filename
|
||||
"~/master-folder/org_files/org_web/posts/career/"))
|
||||
(full-path (expand-file-name filename (site-path "posts/career/")))
|
||||
(date (when (file-exists-p full-path)
|
||||
(org-publish-find-date full-path org-publish-project-alist)))
|
||||
(date-str (if date
|
||||
@@ -356,19 +356,17 @@ A file is WIP if:
|
||||
|
||||
(defun z/wip-sitemap (title list)
|
||||
"Sitemap that lists only entries whose source files are WIP."
|
||||
(let* ((root-dir "~/master-folder/org_files/org_web/") ;; adjust if needed
|
||||
(items
|
||||
(let* ((items
|
||||
(delq
|
||||
nil
|
||||
(mapcar
|
||||
(lambda (entry)
|
||||
(when (consp entry)
|
||||
(let* ((link (car entry))
|
||||
;; Extract relative filename from [[file:...]] link if present
|
||||
(filename (if (string-match "\\[\\[file:\\([^]]+\\)\\]" link)
|
||||
(match-string 1 link)
|
||||
link))
|
||||
(full-path (expand-file-name filename root-dir)))
|
||||
(full-path (expand-file-name filename 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
|
||||
@@ -376,7 +374,7 @@ A file is WIP if:
|
||||
"")))
|
||||
(format "- %s @@html:<span class=\"post-date\">%s</span>@@"
|
||||
link date-str))))))
|
||||
(cdr list))))) ; skip sitemap root
|
||||
(cdr list))))) ;; skip sitemap root
|
||||
(concat
|
||||
"#+TITLE: " title "\n"
|
||||
"#+OPTIONS: toc:nil num:nil\n\n"
|
||||
@@ -386,6 +384,4 @@ A file is WIP if:
|
||||
"No items currently marked as WIP.\n"))))
|
||||
|
||||
|
||||
|
||||
|
||||
(provide 'sitemaps)
|
||||
|
||||
0
lisp/tags.el
Normal file → Executable file
0
lisp/tags.el
Normal file → Executable file
Reference in New Issue
Block a user