Sayfa — a simple, extensible static site generator built in Elixir.
Sayfa (Turkish for "page") provides core SSG functionality as a reusable Hex package. Users create their own sites by depending on Sayfa and writing content in Markdown with YAML front matter.
Quick Start
# Parse a markdown string with front matter
{:ok, content} = Sayfa.parse("---\ntitle: Hello\n---\n# World")
content.title #=> "Hello"
content.body #=> "<h1>...World</h1>" # includes anchor id
# Parse a file
{:ok, content} = Sayfa.parse_file("content/articles/hello.md")
# Render markdown to HTML
{:ok, html} = Sayfa.render_markdown("# Hello **World**")
Summary
Functions
Builds the static site from content files.
Removes the output directory.
Parses a raw string containing YAML front matter and Markdown body.
Reads and parses a content file from disk.
Renders a Markdown string to HTML.
Functions
@spec build(keyword()) :: {:ok, Sayfa.Builder.Result.t()} | {:error, term()}
Builds the static site from content files.
See Sayfa.Builder.build/1 for details and options.
@spec clean(keyword()) :: :ok
Removes the output directory.
See Sayfa.Builder.clean/1 for details.
@spec parse(String.t()) :: {:ok, Sayfa.Content.t()} | {:error, term()}
Parses a raw string containing YAML front matter and Markdown body.
See Sayfa.Content.parse/1 for details.
@spec parse_file(String.t()) :: {:ok, Sayfa.Content.t()} | {:error, term()}
Reads and parses a content file from disk.
See Sayfa.Content.parse_file/1 for details.
Renders a Markdown string to HTML.
See Sayfa.Markdown.render/1 for details.