View Source Tableau.Extension behaviour (tableau v0.4.0)
A tableau extension.
An extension can be used to generate other kinds of content.
types
Types
There are currently the following extension types:
:pre_build
- executed before tableau builds your site and writes anything to disk.
priority
Priority
Extensions can be assigned a numeric priority for used with sorting.
defmodule MySite.PostsExtension do
use Tableau.Extension, type: :pre_build, priority: 300
def run(_site) do
posts = Path.wildcard("_posts/**/*.md")
for post <- post do
post
|> Markdown.render()
|> then(&File.write(Path.join(Path.rootname(post), "index.html"), &1))
end
:ok
end
end
Link to this section Summary
Link to this section Callbacks
@callback run(map()) :: :ok | :error
The extension entry point.
The function is passed the a set of default assigns.