scriptorium/config

The configuration is the main way to customize Scriptorium’s behaviour.

Types

Author related configuration.

pub type Author {
  Author(
    name: String,
    email: option.Option(String),
    url: option.Option(String),
  )
}

Constructors

  • Author(
      name: String,
      email: option.Option(String),
      url: option.Option(String),
    )

    Arguments

    • name

      Name of the author.

    • email

      Email address of the author, used in the feed’s author information.

    • url

      Website URL of the author, used in the feed’s author information and added as a rel="me" link in the base layout.

Compiling related configuration.

pub type Compiling {
  Compiling(
    database_compiler: fn(Database, Compiler) -> CompileDatabase,
    item_compiler: Compiler,
  )
}

Constructors

  • Compiling(
      database_compiler: fn(Database, Compiler) -> CompileDatabase,
      item_compiler: Compiler,
    )

    Arguments

    • database_compiler

      The compiler to use for compiling the database.

    • item_compiler

      The compiler to use for compiling individual items.

pub type Configuration {
  Configuration(
    blog_name: String,
    blog_url: String,
    language: String,
    author: Author,
    compiling: Compiling,
    rendering: Rendering,
    paths: PathConfiguration,
    parser: Parser,
    writer: Writer,
    output_path: String,
  )
}

Constructors

  • Configuration(
      blog_name: String,
      blog_url: String,
      language: String,
      author: Author,
      compiling: Compiling,
      rendering: Rendering,
      paths: PathConfiguration,
      parser: Parser,
      writer: Writer,
      output_path: String,
    )

    Arguments

    • blog_name

      Name of the blog.

    • blog_url

      Absolute URL of the blog, this is where you are deploying it.

    • language

      Language code of the blog, meaning the language of the content you are writing. The language code must be according to https://datatracker.ietf.org/doc/html/rfc5646.

    • output_path

      The folder to write the output into.

An error occurred when parsing input files.

pub type ParseError {
  ParseError(err: String)
}

Constructors

  • ParseError(err: String)

The parser

pub type Parser =
  fn() -> Result(Database, ParseError)

Renders the content of the database into HTML.

pub type Renderer =
  fn(Database, CompileDatabase, Configuration) -> RenderDatabase

Rendering related configuration.

pub type Rendering {
  Rendering(
    renderer: Renderer,
    views: Views,
    copyright: String,
    posts_per_page: Int,
    posts_in_feed: Int,
  )
}

Constructors

  • Rendering(
      renderer: Renderer,
      views: Views,
      copyright: String,
      posts_per_page: Int,
      posts_in_feed: Int,
    )

    Arguments

    • renderer

      The renderer to use.

    • views

      The view generators to use.

    • copyright

      The copyright statement of the blog, used in the footer and the feed.

    • posts_per_page

      How many posts to show per page.

    • posts_in_feed

      How many posts to render in the feed.

View generators for the blog. These take the database and configuration and must return a view function that is used for rendering.

See the scriptorium/rendering/views documentation for descriptions of the individual views.

pub type Views {
  Views(
    base: fn(Database, Configuration) -> BaseView,
    meta: fn(Database, Configuration) -> MetaView,
    single_post_full: fn(Database, Configuration) ->
      SinglePostView,
    single_post_list: fn(Database, Configuration) ->
      SinglePostView,
    page: fn(Database, Configuration) -> PageView,
    list_page: fn(Database, Configuration) -> ListPageView,
    feed: fn(Database, Configuration) -> FeedView,
  )
}

Constructors

  • Views(
      base: fn(Database, Configuration) -> BaseView,
      meta: fn(Database, Configuration) -> MetaView,
      single_post_full: fn(Database, Configuration) -> SinglePostView,
      single_post_list: fn(Database, Configuration) -> SinglePostView,
      page: fn(Database, Configuration) -> PageView,
      list_page: fn(Database, Configuration) -> ListPageView,
      feed: fn(Database, Configuration) -> FeedView,
    )

    Arguments

    • single_post_full

      View for a single post that is rendered on its own.

    • single_post_list

      View for a single post rendered as part of a list.

An error occurred when writing the rendered results into files.

pub type WriteError {
  WriteError(err: String)
}

Constructors

  • WriteError(err: String)

Writes the rendered HTML into files.

pub type Writer =
  fn(RenderDatabase, Configuration) -> Result(Nil, WriteError)
Search Document