   [p permalink-fn PERMALINKFN code  "function to build permalink from TmpFile metadata"
    _ filterer     FILTER      code  "predicate to use for selecting entries (default: `identity`)"
    e extensions   EXTENSIONS  [str] "extensions of files to include"]
-  (let [options (merge +permalink-defaults+ *opts*)
-        permalink-fn (:permalink-fn options)
+  (let [{:keys [permalink-fn] :as options} (merge +permalink-defaults+ *opts*)
         path-fn (fn [global-meta m]
                   (let [permalink (permalink-fn global-meta m)]
                     (str (:doc-root global-meta)

          (u/fail "collection task :sortby option value should implement IFn\n")
          :else
          (let [collection-paths (partial grouped-paths "collection")]
            (render-pre-wrap "collection" collection-paths options :io.perun/collection)))))

(deftask inject-scripts
  "Inject JavaScript scripts into html files.

  (let [pod     (create-pod markdown-deps)
        options (merge +markdown-defaults+ *opts*)]
    (content-pre-wrap
     {:parse-form-fn (fn [meta] `(io.perun.markdown/parse-markdown ~meta ~options))
      :extensions [".md" ".markdown"]
      :output-extension ".html"
      :tracer :io.perun/markdown
      :options options
      :pod pod})))

(deftask global-metadata
  "Read global metadata from `perun.base.edn` or configured file.
