removed unused functions
This commit is contained in:
parent
97187f7028
commit
6c1159289d
2 changed files with 3 additions and 30 deletions
|
@ -24,19 +24,6 @@
|
||||||
matches (map #(re-find % name) ignored-files)]
|
matches (map #(re-find % name) ignored-files)]
|
||||||
(not (some seq matches)))))
|
(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]
|
(defn create-folder [folder]
|
||||||
(let [loc (io/file (new-io/path public folder))]
|
(let [loc (io/file (new-io/path public folder))]
|
||||||
(when-not (.exists loc)
|
(when-not (.exists loc)
|
||||||
|
@ -49,11 +36,6 @@
|
||||||
(create-folder (.getParent (io/file file)))
|
(create-folder (.getParent (io/file file)))
|
||||||
(create-file file data))
|
(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]
|
(defn copy-dir [src target ignored-files]
|
||||||
(fs/mkdirs target)
|
(fs/mkdirs target)
|
||||||
(let [^java.io.FilenameFilter filename-filter (apply reject-re-filter ignored-files)
|
(let [^java.io.FilenameFilter filename-filter (apply reject-re-filter ignored-files)
|
||||||
|
@ -75,13 +57,3 @@
|
||||||
(copy-dir src target ignored-files)
|
(copy-dir src target ignored-files)
|
||||||
:else
|
:else
|
||||||
(fs/copy src target)))))
|
(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")]}))))
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
(ns cryogen-core.sitemap
|
(ns cryogen-core.sitemap
|
||||||
(:require [clojure.xml :refer [emit]]
|
(: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))
|
(:import java.util.Date))
|
||||||
|
|
||||||
;;generate sitemaps using the sitemap spec
|
;;generate sitemaps using the sitemap spec
|
||||||
|
@ -19,7 +20,7 @@
|
||||||
{:tag :urlset
|
{:tag :urlset
|
||||||
:attrs {:xmlns "http://www.sitemaps.org/schemas/sitemap/0.9"}
|
:attrs {:xmlns "http://www.sitemaps.org/schemas/sitemap/0.9"}
|
||||||
:content
|
: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
|
{:tag :url
|
||||||
:content
|
:content
|
||||||
[{:tag :loc
|
[{:tag :loc
|
||||||
|
|
Loading…
Reference in a new issue