Change output directory and how we compile the blog files, call make org when building

This commit is contained in:
Joseph Ferano 2025-07-26 11:37:09 +07:00
parent 9f4b04da7d
commit dbbe42411a
4 changed files with 21 additions and 16 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@ build/*
\*Claude*
/resources/static/output.css
/node_modules/
/org/output/

View File

@ -13,7 +13,7 @@ build:
clj -M:build
org: ./org/*
emacs -Q --script build-org.el
emacs -Q --script build-org.el 2>&1
watch: tailwind static build

View File

@ -5,17 +5,18 @@
'(("org-files"
:recursive t
:base-directory "./org"
:publishing-directory "./build/blog/"
:publishing-directory "./org/output/"
:publishing-function org-html-publish-to-html
:body-only t
:with-author nil ;; Don't include author name
:with-creator nil ;; Include Emacs and Org versions in footer
:with-toc nil ;; Include a table of contents
:title "Joseph Ferano - Blog"
:with-title nil
:with-validation nil
:section-numbers nil ;; Don't include section numbers
:time-stamp-file nil)
;; :with-author nil ;; Don't include author name
;; :with-creator nil ;; Include Emacs and Org versions in footer
;; :with-toc nil ;; Include a table of contents
;; :with-title nil
;; :with-validation nil
;; :section-numbers nil ;; Don't include section numbers
;; :time-stamp-file nil
)
("static-files"
:base-directory "./content/"
:base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|svg"

View File

@ -1,6 +1,7 @@
(ns ferano-io.main
(:require [clojure.string :as str]
[clojure.java.io :as io]
[clojure.java.shell :refer [sh]]
[hiccup.core :as h]
[hiccup.page :as page]
[clojure.edn :as edn]))
@ -142,29 +143,31 @@
[:style ".menu-toggle:checked + label + .mobile-menu { opacity: 1; visibility: visible; transform: translateY(0); } .menu-toggle { display: none; } .mobile-menu { opacity: 0; visibility: hidden; transform: translateY(-10px); transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease; } .mobile-menu a { display: block; }"]]
[:body
[:div {:class "min-h-screen bg-gray-50"}
(header data)
body
(contact data)]]))
(defn main-page [data]
(page-template
data
(let [fns [header hero projects-grid games blog-summary]]
(let [fns [hero projects-grid games blog-summary]]
(map #(% data) fns))))
(defn blog-page [data blog-entry-path]
(let [path (str "org/" blog-entry-path)]
(println path)
(let [path (str "org/output/" blog-entry-path)]
(page-template data (slurp path))))
(defn build-website []
(println (:out (sh "make" "org")))
(let [data (edn/read-string (slurp "resources/data.edn"))
blog-entries (.list (io/file "org/"))
blog-entries (.list (io/file "org/output"))
data (assoc data :blog-entries blog-entries)]
(spit "build/index.html" (main-page data))
(println "Generated index.html")
(doseq [entry blog-entries]
(spit (str "build/blog/" (str/replace entry #"\.org$" ".html"))
(blog-page data entry)))))
(spit (str "build/blog/" entry) (blog-page data entry)))))
(defn -main [& args]
(build-website)
(println "Generated website!"))
(println "Generated website!")
(shutdown-agents))