diff --git a/.gitignore b/.gitignore index 7d24fc1..a48ef4f 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ build/* \*Claude* /resources/static/output.css /node_modules/ +/org/output/ diff --git a/Makefile b/Makefile index 7285279..6ba77c8 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/build-org.el b/build-org.el index 1cc7d4c..41074f8 100644 --- a/build-org.el +++ b/build-org.el @@ -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" diff --git a/src/ferano_io/main.clj b/src/ferano_io/main.clj index 1cc6dd8..3f731e0 100644 --- a/src/ferano_io/main.clj +++ b/src/ferano_io/main.clj @@ -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))