    e extensions EXTENSIONS [str] "extensions of files to include"
    r renderer   RENDERER   sym   "page renderer (fully qualified symbol which resolves to a function)"
    m meta       META       edn   "metadata to set on each entry"]
-  (let [{:keys [renderer] :as options} (merge +render-defaults+ *opts*)]
+  (let [{:keys [renderer out-dir] :as options} (merge +render-defaults+ *opts*)]
     (letfn [(render-paths [fileset]
               (let [entries (filter-meta-by-ext fileset options)]
                 (reduce
-                 (fn [result {:keys [out-dir filename path] :as entry}]
+                 (fn [result {:keys [path] :as entry}]
                    (let [content (slurp (boot/tmp-file (boot/tmp-get fileset path)))
-                         path-args (if (= out-dir (:out-dir options)) ;; if custom out-dir we cannot rely on pre-built :path
-                                     [path]
-                                     [out-dir (:out-dir options) filename])
-                         new-path (apply perun/create-filepath path-args)
+                         new-path (apply-out-dir path (:out-dir entry) out-dir)
                          new-entry (merge entry
                                           meta
                                           {:content content
-                                           :out-dir (:out-dir options)})]
+                                           :out-dir out-dir})]
                      (assoc result new-path {:meta    (pm/get-global-meta fileset)
                                              :entries entries
                                              :entry   new-entry

  (let [global-meta (pm/get-global-meta fileset)]
    (reduce (fn [result {:keys [path] :as entry}]
              (let [ext-pattern (re-pattern (str "(" (string/join "|" extensions) ")$"))
                    new-path (if out-ext
                               (->> out-ext
                                    (string/replace path ext-pattern)
                                    (perun/create-filepath out-dir))
                               (perun/create-filepath out-dir path))
                    path-meta (pm/path-meta path
                                            global-meta
                                            (boot/tmp-file (boot/tmp-get fileset path)))]

      (-> fileset
          (commit tmp)
          (pm/set-meta updated-metas)))))

(defn apply-out-dir
  [path old-out-dir new-out-dir]
  (let [path-args (if (= old-out-dir new-out-dir)
                    [path]
                    [new-out-dir path])]
    (apply perun/create-filepath path-args)))

(defn render-in-pod
  "Renders paths in `inputs`, using `render-form-fn` in `pod`
