site.fabricate.prototype.hiccup
Namespace

Functions for transforming Hiccup elements after processing.

Functions

->meta
Description
Convert the given key/value pair to a Hiccup/HTML metadata element.
Arguments
  • [[k v]]
doc-header
Description
Returns a default header from a map with a post's metadata.
Arguments
  • [{:keys [title page-style scripts] :as metadata}]
opengraph-enhance
Description
Enriches the metadata items given by mapping from metadata names to opengraph properties. See https://stackoverflow.com/a/22984013 for more context on combining these attributes in a single HTML <meta> element.
Arguments
  • [prop-names items]
parse-paragraphs
Description
Detects the paragraphs within the form based on a delimiter and separates them into distinct <p> elements.
Arguments
  • [form {:keys [paragraph-pattern default-form current-paragraph?] :or {paragraph-pattern #"\n\n" default-form [:p] current-paragraph? false} :as opts}]
  • [form]
lift-metadata
Description
Lifts the metadata out of the page contents and into the given metadata map.
Arguments
  • [page-contents metadata]

Constants

opengraph-properties
Description
Mapping of strings and keywords to corresponding opengraph properties. See https://ogp.me/ for more details.
Type
clojure.lang.PersistentHashMap
default-metadata
Description
Additional default metadata for Fabricate HTML pages.
Type
clojure.lang.PersistentList
default-metadata-map
Description
Default metadata for Fabricate HTML pages.
Type
clojure.lang.PersistentArrayMap