Packages
arctic
4.0.0
11.0.10
11.0.9
11.0.8
11.0.7
11.0.6
11.0.6-z6
11.0.6-z5
11.0.6-z4
11.0.6-z3
11.0.6-z2
11.0.6-z1
11.0.6-gamma
11.0.6-delta
11.0.6-beta
11.0.6-alpha
11.0.5
11.0.4
11.0.3
11.0.2
11.0.1
11.0.0
11.0.0-alpha5
11.0.0-alpha4
11.0.0-alpha3
11.0.0-alpha2
11.0.0-alpha
10.0.1
10.0.0
10.0.0-alpha2
10.0.0-alpha
9.0.5
9.0.4
9.0.3
9.0.2
9.0.0
8.0.0
7.0.0
6.0.0
5.0.0
4.0.0
3.0.0
2.0.0
1.0.1
1.0.0
A friendly web framework for fast response times and a lightweight or serverless backend, written in Gleam!
Current section
Files
Jump to
Current section
Files
src/arctic.gleam
import gleam/option.{type Option}
import gleam/order.{type Order}
import lustre/element.{type Element}
import snag.{type Result}
import gleam/dict.{type Dict}
pub type Collection {
Collection(
directory: String,
parse: fn(String) -> Result(Page),
index: Option(fn(List(Page)) -> Element(Nil)),
rss: Option(fn(List(Page)) -> String),
)
}
pub type Page {
Page(
id: String,
above: fn(Page) -> Order,
html: Element(Nil),
metadata: Dict(String, String)
)
}
pub type ProcessedCollection {
ProcessedCollection(collection: Collection, pages: List(Page))
}
pub type MainPage {
MainPage(id: String, html: Element(Nil))
}
pub type Config {
Config(
render_home: fn(List(ProcessedCollection)) -> Element(Nil),
main_pages: List(MainPage),
)
}