tale/config

Types

Menu item with weight items are ordered per weight starting for the smaller one

pub type MenuItem {
  MenuItem(label: String, url: String, weight: Int)
}

Constructors

  • MenuItem(label: String, url: String, weight: Int)

Config types REpresents all the options in the config.toml

pub type SiteConfig {
  SiteConfig(
    title: String,
    theme: String,
    description: String,
    author: String,
    base_url: String,
    public_root: String,
    content_dir: String,
    pagination: option.Option(Int),
    menu_main: List(MenuItem),
  )
}

Constructors

  • SiteConfig(
      title: String,
      theme: String,
      description: String,
      author: String,
      base_url: String,
      public_root: String,
      content_dir: String,
      pagination: option.Option(Int),
      menu_main: List(MenuItem),
    )

Paths of all directories in the newly created site

pub type SitePaths {
  SitePaths(
    content: String,
    layouts: String,
    partials: String,
    assets: String,
    static: String,
  )
}

Constructors

  • SitePaths(
      content: String,
      layouts: String,
      partials: String,
      assets: String,
      static: String,
    )

Values

pub const config_path: String

Site configuration file

pub fn load() -> Result(SiteConfig, String)

Loads the configuration file

pub fn public_root(config: SiteConfig) -> String

Configure public root. By default this is public but user can change it in the config.toml file.

pub fn site_paths(config: SiteConfig) -> SitePaths

Site path for the themes

Search Document