Cherry (cherry v0.3.0)

Copy Markdown View Source

A static site generator for hackers — a modern take on Octopress.

Cherry builds fast static sites with a blog and a data-driven portfolio, driven by mix tasks (or the standalone cherry binary). See the README for the tour; the design lives in the GitHub repo.

Summary

Functions

Builds a site: loads cherry.exs from :source and runs the pipeline.

Verifies a site: builds it in memory (nothing is written) and runs every Cherry.Check rule against the result.

The git revision this build was compiled from, or nil.

The Cherry version string, as compiled into the application spec.

Functions

build(opts)

@spec build(keyword()) :: {:ok, Cherry.Build.t()} | {:error, String.t()}

Builds a site: loads cherry.exs from :source and runs the pipeline.

Options: :source (site root, required), :output (defaults to source/_site), plus the selection options of Cherry.Build.Options (:drafts, :future, :today).

check(opts)

@spec check(keyword()) ::
  {:ok, Cherry.Build.t(), [Cherry.Check.Diagnostic.t()]} | {:error, String.t()}

Verifies a site: builds it in memory (nothing is written) and runs every Cherry.Check rule against the result.

revision()

@spec revision() :: String.t() | nil

The git revision this build was compiled from, or nil.

Present when Cherry was compiled from a checkout — which includes the released binaries, since CI builds them from one — and absent when it was compiled from a hex package.

version()

@spec version() :: String.t()

The Cherry version string, as compiled into the application spec.

Examples

iex> Cherry.version() =~ ~r/^\d+\.\d+\.\d+/
true