From 6c1159289d17a3c9a4ea777f3f591de23b69fe8a Mon Sep 17 00:00:00 2001 From: lukas Date: Thu, 20 Feb 2020 13:51:48 +0100 Subject: [PATCH] removed unused functions --- src/cryogen_core/io.clj | 28 ---------------------------- src/cryogen_core/sitemap.clj | 5 +++-- 2 files changed, 3 insertions(+), 30 deletions(-) diff --git a/src/cryogen_core/io.clj b/src/cryogen_core/io.clj index 9e67310..aa7f3a5 100644 --- a/src/cryogen_core/io.clj +++ b/src/cryogen_core/io.clj @@ -24,19 +24,6 @@ matches (map #(re-find % name) ignored-files)] (not (some seq matches))))) -(defn find-assets - "Find all assets in the given root directory (f) and the given file - extension (ext) ignoring any files that match the given (ignored-files). - First make sure that the root directory exists, if yes: process as normal; - if no, return empty vector." - [f ^String ext ignored-files] - (if-let [root (get-resource f)] - (->> (get-resource f) - file-seq - (filter (ignore ignored-files)) - (filter (fn [^java.io.File file] (-> file .getName (.endsWith ext))))) - [])) - (defn create-folder [folder] (let [loc (io/file (new-io/path public folder))] (when-not (.exists loc) @@ -49,11 +36,6 @@ (create-folder (.getParent (io/file file))) (create-file file data)) -(defn wipe-public-folder [keep-files] - (let [filenamefilter (reify java.io.FilenameFilter (accept [this _ filename] (not (some #{filename} keep-files))))] - (doseq [path (.listFiles (io/file public) filenamefilter)] - (fs/delete-dir path)))) - (defn copy-dir [src target ignored-files] (fs/mkdirs target) (let [^java.io.FilenameFilter filename-filter (apply reject-re-filter ignored-files) @@ -75,13 +57,3 @@ (copy-dir src target ignored-files) :else (fs/copy src target))))) - -(defn copy-resources-from-theme - "Copy resources from theme" - [config] - (let [theme-path (str "themes/" (:theme config))] - (copy-resources - (merge config - {:resources [(str theme-path "/css") - (str theme-path "/js") - (str theme-path "/html/404.html")]})))) diff --git a/src/cryogen_core/sitemap.clj b/src/cryogen_core/sitemap.clj index 9242f15..fca39cf 100644 --- a/src/cryogen_core/sitemap.clj +++ b/src/cryogen_core/sitemap.clj @@ -1,6 +1,7 @@ (ns cryogen-core.sitemap (:require [clojure.xml :refer [emit]] - [cryogen-core.io :as cryogen-io]) + [cryogen-core.io :as cryogen-io] + [cryogen-core.new-io :as new-io]) (:import java.util.Date)) ;;generate sitemaps using the sitemap spec @@ -19,7 +20,7 @@ {:tag :urlset :attrs {:xmlns "http://www.sitemaps.org/schemas/sitemap/0.9"} :content - (for [^java.io.File f (cryogen-io/find-assets "public" ".html" ignored-files)] + (for [^java.io.File f (new-io/find-assets "" ["public"] ".html" ignored-files)] {:tag :url :content [{:tag :loc