Change output directory and how we compile the blog files, call make org when building
This commit is contained in:
parent
9f4b04da7d
commit
dbbe42411a
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,3 +5,4 @@ build/*
|
|||||||
\*Claude*
|
\*Claude*
|
||||||
/resources/static/output.css
|
/resources/static/output.css
|
||||||
/node_modules/
|
/node_modules/
|
||||||
|
/org/output/
|
||||||
|
2
Makefile
2
Makefile
@ -13,7 +13,7 @@ build:
|
|||||||
clj -M:build
|
clj -M:build
|
||||||
|
|
||||||
org: ./org/*
|
org: ./org/*
|
||||||
emacs -Q --script build-org.el
|
emacs -Q --script build-org.el 2>&1
|
||||||
|
|
||||||
watch: tailwind static build
|
watch: tailwind static build
|
||||||
|
|
||||||
|
17
build-org.el
17
build-org.el
@ -5,17 +5,18 @@
|
|||||||
'(("org-files"
|
'(("org-files"
|
||||||
:recursive t
|
:recursive t
|
||||||
:base-directory "./org"
|
:base-directory "./org"
|
||||||
:publishing-directory "./build/blog/"
|
:publishing-directory "./org/output/"
|
||||||
:publishing-function org-html-publish-to-html
|
:publishing-function org-html-publish-to-html
|
||||||
:body-only t
|
: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"
|
:title "Joseph Ferano - Blog"
|
||||||
:with-title nil
|
;; :with-author nil ;; Don't include author name
|
||||||
:with-validation nil
|
;; :with-creator nil ;; Include Emacs and Org versions in footer
|
||||||
:section-numbers nil ;; Don't include section numbers
|
;; :with-toc nil ;; Include a table of contents
|
||||||
:time-stamp-file nil)
|
;; :with-title nil
|
||||||
|
;; :with-validation nil
|
||||||
|
;; :section-numbers nil ;; Don't include section numbers
|
||||||
|
;; :time-stamp-file nil
|
||||||
|
)
|
||||||
("static-files"
|
("static-files"
|
||||||
:base-directory "./content/"
|
:base-directory "./content/"
|
||||||
:base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|svg"
|
:base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|svg"
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
(ns ferano-io.main
|
(ns ferano-io.main
|
||||||
(:require [clojure.string :as str]
|
(:require [clojure.string :as str]
|
||||||
[clojure.java.io :as io]
|
[clojure.java.io :as io]
|
||||||
|
[clojure.java.shell :refer [sh]]
|
||||||
[hiccup.core :as h]
|
[hiccup.core :as h]
|
||||||
[hiccup.page :as page]
|
[hiccup.page :as page]
|
||||||
[clojure.edn :as edn]))
|
[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; }"]]
|
[: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
|
[:body
|
||||||
[:div {:class "min-h-screen bg-gray-50"}
|
[:div {:class "min-h-screen bg-gray-50"}
|
||||||
|
(header data)
|
||||||
body
|
body
|
||||||
(contact data)]]))
|
(contact data)]]))
|
||||||
|
|
||||||
(defn main-page [data]
|
(defn main-page [data]
|
||||||
(page-template
|
(page-template
|
||||||
data
|
data
|
||||||
(let [fns [header hero projects-grid games blog-summary]]
|
(let [fns [hero projects-grid games blog-summary]]
|
||||||
(map #(% data) fns))))
|
(map #(% data) fns))))
|
||||||
|
|
||||||
(defn blog-page [data blog-entry-path]
|
(defn blog-page [data blog-entry-path]
|
||||||
(let [path (str "org/" blog-entry-path)]
|
(let [path (str "org/output/" blog-entry-path)]
|
||||||
(println path)
|
|
||||||
(page-template data (slurp path))))
|
(page-template data (slurp path))))
|
||||||
|
|
||||||
(defn build-website []
|
(defn build-website []
|
||||||
|
(println (:out (sh "make" "org")))
|
||||||
(let [data (edn/read-string (slurp "resources/data.edn"))
|
(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)]
|
data (assoc data :blog-entries blog-entries)]
|
||||||
(spit "build/index.html" (main-page data))
|
(spit "build/index.html" (main-page data))
|
||||||
|
(println "Generated index.html")
|
||||||
(doseq [entry blog-entries]
|
(doseq [entry blog-entries]
|
||||||
(spit (str "build/blog/" (str/replace entry #"\.org$" ".html"))
|
(spit (str "build/blog/" entry) (blog-page data entry)))))
|
||||||
(blog-page data entry)))))
|
|
||||||
|
|
||||||
(defn -main [& args]
|
(defn -main [& args]
|
||||||
(build-website)
|
(build-website)
|
||||||
(println "Generated website!"))
|
(println "Generated website!")
|
||||||
|
(shutdown-agents))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user