View Source Tableau.PageExtension (tableau v0.17.1)

Markdown files (with YAML frontmatter) in the configured pages directory will be automatically compiled into Tableau pages.

Certain frontmatter keys are required and all keys are passed as options to the Tableau.Page.

Options

Frontmatter is compiled with yaml_elixir and all keys are converted to atoms.

  • :title - The title of the page
  • :permalink - The permalink of the page.
  • :layout - A string representation of a Tableau layout module.

Example

id: "GettingStarted"
title: "Getting Started"
permalink: "/docs/:title"
layout: "ElixirTools.PageLayout"

The permalink is a string with colon prefixed template variables.

These variables will be swapped with the corresponding YAML Frontmatter key, with the result being piped through to_string/1.

Configuration

  • :enabled - boolean - Extension is active or not.
  • :dir - string - Directory to scan for markdown files. Defaults to _pages
  • :permalink - string - Default output path for pages. Accepts :title as a replacement keyword, replaced with the page's provided title. If a page has a :permalink provided, that will override this value for that page.
  • :layout - string - Elixir module providing page layout for pages. Default is nil.

Example

config :tableau, Tableau.PageExtension,
  enabled: true,
  dir: "_docs",
  permalink: "/docs/:title",
  layout: "MyApp.PageLayout"

Summary

Functions

Callback implementation for Tableau.Extension.run/1.

Functions

Callback implementation for Tableau.Extension.run/1.