module

Plombir::Router

Class methods

expand(pattern : String, slug : String, title : String, date : Time) : String

Expands a collection permalink pattern (/blog/:year/:slug/) with the page's slug, title, and date. Tokens: :year (YYYY), :month/day (zero-padded), :slug, :title (slugified, so the URL stays safe). Unknown tokens are a config error, caught at load time — here they pass through untouched.

Source
routes(pages : Array(Tuple(String, String | Nil))) : Hash(String, Route)

Resolves every page, raising Conflict on duplicate URLs.

Source
slugify(text : String) : String

Turns My Post! into my-post. Delegates to Utils so routing and the | slugify filter share one definition.

Source

Nested types