arctic/config
Values
pub fn add_collection(
config: arctic.Config,
collection: arctic.Collection,
) -> arctic.Config
Add a “collection” to an Arctic configuration.
A collection holds a bunch of pages and their processing rules,
like a set of products, blog posts, wiki entries, etc.
See arctic/collection
for more.
pub fn add_main_page(
config: arctic.Config,
id: String,
body: @internal Element(Nil),
) -> arctic.Config
Add a “main page” to an Arctic configuration.
Main pages are pages that aren’t a part of any collection, like “Contact” or “About.”
Note that the home page (/index.html
) is handled via home_renderer
instead.
pub fn add_spa_frame(
config: arctic.Config,
frame: fn(@internal Element(Nil)) -> @internal Element(Nil),
) -> arctic.Config
Specify code that is on the outside of a page,
and doesn’t get re-rendered on page navigation.
This can be nav bars, a head
element, side panels, footer, etc.
pub fn home_renderer(
config: arctic.Config,
renderer: fn(List(arctic.ProcessedCollection)) -> @internal Element(
Nil,
),
) -> arctic.Config
Set the renderer for the home page of a site (/index.html
).
Note that a list of all collections, with all of their pages, is provided if you’d like to use it.
pub fn new() -> arctic.Config
Produce a new Arctic configuration, with default settings. An Arctic configuration holds all the collections, pages, parsing rules, etc.
pub fn turn_off_spa(config: arctic.Config) -> arctic.Config
Generate the site as a directory of files, instead of as a single-page app with clever routing.