Huge changes
This commit is contained in:
@@ -10,6 +10,14 @@
|
||||
|
||||
(package-initialize)
|
||||
|
||||
(defvar site-root
|
||||
(file-name-directory
|
||||
(or load-file-name buffer-file-name)))
|
||||
|
||||
(defun site-path (path)
|
||||
(expand-file-name path site-root))
|
||||
|
||||
|
||||
(unless package-archive-contents
|
||||
(package-refresh-contents))
|
||||
|
||||
@@ -133,7 +141,10 @@
|
||||
(add-to-list 'load-path default-directory)
|
||||
|
||||
(defvar z-shared-head
|
||||
"
|
||||
"
|
||||
|
||||
<link rel=\"icon\" type=\"image/png\" sizes=\"48x48\" href=\"/assets/icons/icons8-z-key-64.png\" />
|
||||
|
||||
<link rel=\"stylesheet\" href=\"/assets/styles/style.css\" />
|
||||
<link rel=\"stylesheet\" href=\"/assets/styles/bigger-picture.min.css\" />
|
||||
<link rel=\"stylesheet\" href=\"/assets/styles/media.css\" />
|
||||
@@ -255,8 +266,10 @@ Created with %c on <a href=\"https://www.archlinux.org/\">Arch</a> <a href=\"htt
|
||||
(dolist (bl backlinks)
|
||||
(insert (format "- %s\n" (plist-get bl :link))))))))
|
||||
|
||||
(setq org-id-locations-file "~/.emacs.d/.org-id-locations")
|
||||
(setq org-roam-directory "~/master-folder/org_files/org_roam/")
|
||||
(setq org-id-locations-file
|
||||
(expand-file-name ".org-id-locations"
|
||||
(getenv "HOME")))
|
||||
(setq org-roam-directory site-root)
|
||||
(org-id-update-id-locations)
|
||||
|
||||
(setq org-html-link-home "")
|
||||
@@ -264,7 +277,7 @@ Created with %c on <a href=\"https://www.archlinux.org/\">Arch</a> <a href=\"htt
|
||||
|
||||
(defun z/generate-all-files-org ()
|
||||
"Generate all-files.org from all-files.json."
|
||||
(let* ((base-dir (expand-file-name "~/master-folder/org_files/org_roam/"))
|
||||
(let* ((base-dir site-root)
|
||||
(json-file (expand-file-name "all-files.json" base-dir))
|
||||
(org-file (expand-file-name "all-files.org" base-dir)))
|
||||
(when (file-exists-p json-file)
|
||||
@@ -291,14 +304,12 @@ Created with %c on <a href=\"https://www.archlinux.org/\">Arch</a> <a href=\"htt
|
||||
(insert "\n")))))
|
||||
(message "✅ all-files.org generated"))))
|
||||
|
||||
|
||||
|
||||
(setq org-publish-project-alist
|
||||
`(
|
||||
("org-roam"
|
||||
:base-directory "~/master-folder/org_files/org_roam/"
|
||||
:base-directory "/home/zaine/master-folder/org_files/org_roam/"
|
||||
:base-extension "org"
|
||||
:publishing-directory "~/master-folder/org_files/org_roam/output/"
|
||||
:publishing-directory "/home/zaine/master-folder/org_files/org_roam/output/"
|
||||
:recursive t
|
||||
:publishing-function org-html-publish-to-html
|
||||
:with-author nil
|
||||
@@ -312,9 +323,9 @@ Created with %c on <a href=\"https://www.archlinux.org/\">Arch</a> <a href=\"htt
|
||||
:html-head ,z-shared-head)
|
||||
|
||||
("org-static"
|
||||
:base-directory "~/master-folder/org_files/org_roam/assets/"
|
||||
:base-directory "/home/zaine/master-folder/org_files/org_roam/assets/"
|
||||
:base-extension "css\\|js\\|png\\|jpg\\|gif\\|svg"
|
||||
:publishing-directory "~/master-folder/org_files/org_roam/output/assets/"
|
||||
:publishing-directory "/home/zaine/master-folder/org_files/org_roam/output/assets/"
|
||||
:recursive t
|
||||
:publishing-function org-publish-attachment)))
|
||||
|
||||
@@ -324,13 +335,29 @@ Created with %c on <a href=\"https://www.archlinux.org/\">Arch</a> <a href=\"htt
|
||||
(message-log-max nil))
|
||||
(org-publish project force)))
|
||||
|
||||
(defun z/refresh-org-roam ()
|
||||
"Force Org-roam and Org ID caches to refresh (needed for synced notes)."
|
||||
(message "starting to refresh...")
|
||||
;; Update ID locations
|
||||
(org-id-update-id-locations)
|
||||
|
||||
;; Rebuild roam database
|
||||
(when (featurep 'org-roam)
|
||||
(org-roam-db-clear-all)
|
||||
(org-roam-db-sync))
|
||||
(message "✅ Org-roam DB refreshed"))
|
||||
|
||||
(defun z/build-full ()
|
||||
"Full rebuild: Org, assets, and search index."
|
||||
(interactive)
|
||||
(let* ((start-time (current-time)))
|
||||
(message "🏁 Starting full rebuild at %s"
|
||||
(message "Starting full rebuild at %s"
|
||||
(format-time-string "%Y-%m-%d %H:%M:%S" start-time))
|
||||
|
||||
;; IMPORTANT: refresh roam DB after syncthing updates
|
||||
(org-id-update-id-locations)
|
||||
;(z/refresh-org-roam)
|
||||
|
||||
(setq z/build-full-rebuild t)
|
||||
(z/generate-all-files-org)
|
||||
(z/org-publish-quiet "org-roam" t)
|
||||
|
||||
Reference in New Issue
Block a user