From 78ab11b1cd2d28d0a79b8ca7467435110e7ae8cd Mon Sep 17 00:00:00 2001 From: "Yann Esposito (Yogsototh)" Date: Tue, 16 Jan 2024 09:02:07 +0100 Subject: [PATCH] added resources --- .gitignore | 4 + resources/statyk/index.html | 144 ++++++++++++++++++++++++++++++++++++ resources/statyk/post.html | 64 ++++++++++++++++ statyk | 16 ++-- 4 files changed, 221 insertions(+), 7 deletions(-) create mode 100644 resources/statyk/index.html create mode 100644 resources/statyk/post.html diff --git a/.gitignore b/.gitignore index ad6d464..b0ba90a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,6 @@ .local/ .cpcache/ +.statyk/ +_site/ +_src/ +_templates/ diff --git a/resources/statyk/index.html b/resources/statyk/index.html new file mode 100644 index 0000000..b51f1ce --- /dev/null +++ b/resources/statyk/index.html @@ -0,0 +1,144 @@ + + + + + + $title$ + + + + + + + + + $header-includes$ + + +
+ +
+

$title

+
+ +
+
+

Articles

+$body$ + +

Archives from my previous dead blog

+ + + +
+ + + diff --git a/resources/statyk/post.html b/resources/statyk/post.html new file mode 100644 index 0000000..e5b7d81 --- /dev/null +++ b/resources/statyk/post.html @@ -0,0 +1,64 @@ + + + + + + $title$ + + + + + + + + + $header-includes$ + + +
+ +
+

$title$

+
+ $date$ on + + $author$'s blog +
+
+$description$ +
+
+
+
+$if(toc)$$endif$ +
+$body$ +
+
+ + + diff --git a/statyk b/statyk index 419c5fa..fb55cfe 100755 --- a/statyk +++ b/statyk @@ -5,7 +5,8 @@ #_DEPS is same format as deps.edn. Multiline is okay. DEPS=' - {:deps { + {:paths ["." "resources"] + :deps { org.clojure/tools.cli {:mvn/version "1.0.214"} ring/ring-core {:mvn/version "1.11.0"} ring/ring-jetty-adapter {:mvn/version "1.11.0"} @@ -185,13 +186,12 @@ exec clojure $OPTS -Sdeps "$DEPS" -M "$0" "$@" "- clean delete generated files in _site"])) (System/exit 0)) -(defn cp-resource [resource-name] - (let [dst (str ".statyk/" resource-name)] +(defn cp-resource [dst-dir resource-name] + (let [dst (str dst-dir "/" resource-name)] (println (format "Generating: %s" dst)) (if-let [resource (io/resource (str "statyk/" resource-name))] (spit dst (slurp resource)) - (err! "Cannot read %s" (io/resource (str "statyk/" resource-name))) - ))) + (err! "Cannot read %s" (io/resource (str "statyk/" resource-name)))))) (defn init-site [_options] @@ -204,8 +204,10 @@ exec clojure $OPTS -Sdeps "$DEPS" -M "$0" "$@" (doseq [f ["org-links-to-html.lua" "img-to-webp.lua" "metas.lua"]] - (cp-resource f)) - + (cp-resource ".statyk" f)) + (doseq [f ["index.html" + "post.html"]] + (cp-resource (:templates-directory config) f)) ) (defn -main [& args]