This commit is contained in:
@@ -173,13 +173,28 @@ FMT / ARGS are passed to `format'."
|
|||||||
|
|
||||||
(setq org-html-htmlize-output-type 'css)
|
(setq org-html-htmlize-output-type 'css)
|
||||||
|
|
||||||
|
(defun z/asset-version (path)
|
||||||
|
"Return a cache-busting version string for asset PATH under `z/site-root'."
|
||||||
|
(let* ((file (site-path path))
|
||||||
|
(attrs (and (file-exists-p file) (file-attributes file)))
|
||||||
|
(mtime (and attrs (file-attribute-modification-time attrs)))
|
||||||
|
(size (and attrs (file-attribute-size attrs))))
|
||||||
|
(if (and mtime size)
|
||||||
|
(format "%x-%x" (floor (float-time mtime)) size)
|
||||||
|
(format "%x" (floor z/build-start-time)))))
|
||||||
|
|
||||||
|
(defun z/asset-url (path)
|
||||||
|
"Return root-relative asset PATH with a deterministic cache-busting query."
|
||||||
|
(format "/%s?v=%s" path (z/asset-version path)))
|
||||||
|
|
||||||
(defvar z/shared-head
|
(defvar z/shared-head
|
||||||
(concat
|
(concat
|
||||||
"<link rel=\"icon\" type=\"image/png\" sizes=\"48x48\""
|
"<link rel=\"icon\" type=\"image/png\" sizes=\"48x48\""
|
||||||
" href=\"/assets/icons/icons8-film-tape-100.png\" />\n"
|
" href=\"/assets/icons/icons8-film-tape-100.png\" />\n"
|
||||||
(mapconcat
|
(mapconcat
|
||||||
(lambda (f)
|
(lambda (f)
|
||||||
(format "<link rel=\"stylesheet\" href=\"/assets/styles/%s\" />" f))
|
(format "<link rel=\"stylesheet\" href=\"%s\" />"
|
||||||
|
(z/asset-url (format "assets/styles/%s" f))))
|
||||||
'("style.css"
|
'("style.css"
|
||||||
"bigger-picture.min.css"
|
"bigger-picture.min.css"
|
||||||
"comments.css"
|
"comments.css"
|
||||||
@@ -194,7 +209,8 @@ FMT / ARGS are passed to `format'."
|
|||||||
"\n"
|
"\n"
|
||||||
(mapconcat
|
(mapconcat
|
||||||
(lambda (f)
|
(lambda (f)
|
||||||
(format "<script src=\"/assets/scripts/%s\" defer></script>" f))
|
(format "<script src=\"%s\" defer></script>"
|
||||||
|
(z/asset-url (format "assets/scripts/%s" f))))
|
||||||
'("script.js"
|
'("script.js"
|
||||||
"lunr.js"
|
"lunr.js"
|
||||||
"competency-status-board.js"
|
"competency-status-board.js"
|
||||||
@@ -209,7 +225,7 @@ FMT / ARGS are passed to `format'."
|
|||||||
"zhd.js"
|
"zhd.js"
|
||||||
)
|
)
|
||||||
"\n")
|
"\n")
|
||||||
"<script src=\"/assets/scripts/mermaid.min.js\"></script>
|
(format "<script src=\"%s\"></script>
|
||||||
<script>
|
<script>
|
||||||
window.addEventListener('load', function() {
|
window.addEventListener('load', function() {
|
||||||
mermaid.initialize({ startOnLoad: false, theme: 'neutral' });
|
mermaid.initialize({ startOnLoad: false, theme: 'neutral' });
|
||||||
@@ -222,6 +238,7 @@ FMT / ARGS are passed to `format'."
|
|||||||
mermaid.run({ querySelector: '.mermaid' });
|
mermaid.run({ querySelector: '.mermaid' });
|
||||||
});
|
});
|
||||||
</script>"
|
</script>"
|
||||||
|
(z/asset-url "assets/scripts/mermaid.min.js"))
|
||||||
)
|
)
|
||||||
"Shared <head> HTML fragment injected into every page.")
|
"Shared <head> HTML fragment injected into every page.")
|
||||||
|
|
||||||
@@ -669,9 +686,8 @@ Created with %c on <a href=\"https://www.archlinux.org/\">Arch</a> \
|
|||||||
(z/log 'info "Site output root : %s" z/output-root)
|
(z/log 'info "Site output root : %s" z/output-root)
|
||||||
|
|
||||||
(defun z/wipe-build-dirs ()
|
(defun z/wipe-build-dirs ()
|
||||||
"Delete output/, tags/, and .org-timestamps/ together."
|
"Delete output/ and .org-timestamps/ together."
|
||||||
(dolist (dir (list z/output-root
|
(dolist (dir (list z/output-root
|
||||||
(site-path "tags/")
|
|
||||||
(site-path ".org-timestamps/")))
|
(site-path ".org-timestamps/")))
|
||||||
(if (file-directory-p dir)
|
(if (file-directory-p dir)
|
||||||
(progn
|
(progn
|
||||||
@@ -699,7 +715,7 @@ A nil result means the timestamp cache is stale and we must force-republish."
|
|||||||
(cond
|
(cond
|
||||||
;; ── Explicit clean requested ───────────────────────────────────────────────
|
;; ── Explicit clean requested ───────────────────────────────────────────────
|
||||||
((getenv "SITE_CLEAN")
|
((getenv "SITE_CLEAN")
|
||||||
(z/log 'warn "SITE_CLEAN=1 — wiping output/, tags/, and .org-timestamps/")
|
(z/log 'warn "SITE_CLEAN=1 — wiping output/ and .org-timestamps/")
|
||||||
(z/wipe-build-dirs)
|
(z/wipe-build-dirs)
|
||||||
(setenv "SITE_FORCE" "1"))
|
(setenv "SITE_FORCE" "1"))
|
||||||
|
|
||||||
@@ -743,14 +759,29 @@ A nil result means the timestamp cache is stale and we must force-republish."
|
|||||||
|
|
||||||
(z/log-separator "Publishing")
|
(z/log-separator "Publishing")
|
||||||
|
|
||||||
|
(defun z/sync-assets-to-output ()
|
||||||
|
"Copy assets/ into the configured output assets directory, overwriting stale files."
|
||||||
|
(let ((source-root (site-path "assets/"))
|
||||||
|
(target-root (output-path "assets/")))
|
||||||
|
(when (file-directory-p source-root)
|
||||||
|
(dolist (file (directory-files-recursively source-root ".*" nil))
|
||||||
|
(unless (file-directory-p file)
|
||||||
|
(let* ((rel (file-relative-name file source-root))
|
||||||
|
(target (expand-file-name rel target-root)))
|
||||||
|
(make-directory (file-name-directory target) t)
|
||||||
|
(copy-file file target t t t t)))))))
|
||||||
|
|
||||||
(if (getenv "SITE_DRY")
|
(if (getenv "SITE_DRY")
|
||||||
(z/log 'warn "SITE_DRY=1 — skipping org-publish-all (dry run)")
|
(z/log 'warn "SITE_DRY=1 — skipping org-publish-all (dry run)")
|
||||||
(let ((force (not (not (getenv "SITE_FORCE")))))
|
(let ((force (not (not (getenv "SITE_FORCE")))))
|
||||||
(when force
|
(when force
|
||||||
(z/log 'info "SITE_FORCE=1 — forcing republish of all files"))
|
(z/log 'info "SITE_FORCE=1 — forcing republish of all files"))
|
||||||
(condition-case err
|
(condition-case err
|
||||||
(z/with-timing "org-publish-all"
|
(progn
|
||||||
(org-publish-all force))
|
(z/with-timing "org-publish-all"
|
||||||
|
(org-publish-all force))
|
||||||
|
(z/with-timing "asset sync"
|
||||||
|
(z/sync-assets-to-output)))
|
||||||
(error
|
(error
|
||||||
(z/log 'error "org-publish-all failed: %s" (error-message-string err))
|
(z/log 'error "org-publish-all failed: %s" (error-message-string err))
|
||||||
(error "Build failed")))))
|
(error "Build failed")))))
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
See the categories: @@html:<a href="../home/categories.html">Categories</a>@@
|
See the categories: @@html:<a href="../home/categories.html">Categories</a>@@
|
||||||
|
|
||||||
* Posts:
|
* Posts:
|
||||||
- [[file:career/career-list.org][Career List]] @@html:<span class="post-date">09-05-2026 18:33</span>@@
|
- [[file:career/career-list.org][Career List]] @@html:<span class="post-date">09-05-2026 18:44</span>@@
|
||||||
- [[file:career/ha-dr.org][High Availability, Disaster Recovery and Business Continuity]] @@html:<span class="post-date">11-03-2026 17:18</span>@@ @@html:<a href="/tags/learning.html"><span class="post-tag">learning</span></a>@@ @@html:<a href="/tags/notes.html"><span class="post-tag">notes</span></a>@@
|
- [[file:career/ha-dr.org][High Availability, Disaster Recovery and Business Continuity]] @@html:<span class="post-date">11-03-2026 17:18</span>@@ @@html:<a href="/tags/learning.html"><span class="post-tag">learning</span></a>@@ @@html:<a href="/tags/notes.html"><span class="post-tag">notes</span></a>@@
|
||||||
- [[file:career/javascript.org][Understands the Javascript language]] @@html:<span class="post-date">11-03-2026 16:52</span>@@ @@html:<a href="/tags/learning.html"><span class="post-tag">learning</span></a>@@ @@html:<a href="/tags/notes.html"><span class="post-tag">notes</span></a>@@
|
- [[file:career/javascript.org][Understands the Javascript language]] @@html:<span class="post-date">11-03-2026 16:52</span>@@ @@html:<a href="/tags/learning.html"><span class="post-tag">learning</span></a>@@ @@html:<a href="/tags/notes.html"><span class="post-tag">notes</span></a>@@
|
||||||
- [[file:career/restful-api.org][Restful API]] @@html:<span class="post-date">15-02-2026 23:00</span>@@ @@html:<a href="/tags/learning.html"><span class="post-tag">learning</span></a>@@ @@html:<a href="/tags/notes.html"><span class="post-tag">notes</span></a>@@
|
- [[file:career/restful-api.org][Restful API]] @@html:<span class="post-date">15-02-2026 23:00</span>@@ @@html:<a href="/tags/learning.html"><span class="post-tag">learning</span></a>@@ @@html:<a href="/tags/notes.html"><span class="post-tag">notes</span></a>@@
|
||||||
|
|||||||
@@ -49,17 +49,17 @@
|
|||||||
- [[file:posts/career/ha-dr.org][High Availability, Disaster Recovery and Business Continuity]]
|
- [[file:posts/career/ha-dr.org][High Availability, Disaster Recovery and Business Continuity]]
|
||||||
- [[file:posts/career/career-list.org][Career List]]
|
- [[file:posts/career/career-list.org][Career List]]
|
||||||
- tags
|
- tags
|
||||||
- [[file:tags/review.sync-conflict-20260328-203248-VT6366A.org][Tag: review]]
|
|
||||||
- [[file:tags/life.sync-conflict-20260417-233423-VT6366A.org][Tag: life]]
|
- [[file:tags/life.sync-conflict-20260417-233423-VT6366A.org][Tag: life]]
|
||||||
|
- [[file:tags/review.sync-conflict-20260328-203248-VT6366A.org][Tag: review]]
|
||||||
- [[file:tags/introduction.org][Tag: introduction]]
|
- [[file:tags/introduction.org][Tag: introduction]]
|
||||||
- [[file:tags/learning.org][Tag: learning]]
|
- [[file:tags/learning.org][Tag: learning]]
|
||||||
- [[file:tags/notes.org][Tag: notes]]
|
- [[file:tags/notes.org][Tag: notes]]
|
||||||
- [[file:tags/review.org][Tag: review]]
|
- [[file:tags/review.org][Tag: review]]
|
||||||
- [[file:tags/website.org][Tag: website]]
|
- [[file:tags/website.org][Tag: website]]
|
||||||
- [[file:tags/update.org][Tag: update]]
|
- [[file:tags/update.org][Tag: update]]
|
||||||
- [[file:tags/insights.org][Tag: insights]]
|
|
||||||
- [[file:tags/life.org][Tag: life]]
|
- [[file:tags/life.org][Tag: life]]
|
||||||
- [[file:tags/education.org][Tag: education]]
|
- [[file:tags/education.org][Tag: education]]
|
||||||
|
- [[file:tags/insights.org][Tag: insights]]
|
||||||
- [[file:tags/reading.org][Tag: reading]]
|
- [[file:tags/reading.org][Tag: reading]]
|
||||||
- [[file:tags/emacs.org][Tag: emacs]]
|
- [[file:tags/emacs.org][Tag: emacs]]
|
||||||
- [[file:tags/maths.org][Tag: maths]]
|
- [[file:tags/maths.org][Tag: maths]]
|
||||||
Reference in New Issue
Block a user