module

Render

Constants

BASE_URL = ENV.fetch("BASE_URL", "https://crystal-shards.online")
NEW_PERIODS = {"today" => 1, "week" => 7, "month" => 30, "year" => 365}

Class methods

activity(site : SiteData) : String
Source
activity_chart(site : SiteData, months = 36, full_history = false) : String

Inline SVG bar chart: shards created per month. Bars are links to the per-month listing (/new?month=YYYY-MM). Server-side, no JavaScript.

Source
asset_v

Cache-busting version for /assets/style.css: the file's mtime, so a changed stylesheet gets a new URL and browsers never serve stale CSS.

Source
card(s : Shard) : String
Source
categories(site : SiteData) : String
Source
category(slug : String, shards : Array(Shard), sort : String | Nil = nil, filter5 : Bool = false) : String
Source
category_counts(shards : Array(Shard)) : Array(Tuple(String, Int32))
Source
category_url(slug : String, sort : String | Nil, filter5 : Bool) : String
Source
error(code : Int32, message : String) : String
Source
index(site : SiteData) : String
Source
month_title(month : String) : String
Source
new_shards(period : String, month : String | Nil, shards : Array(Shard), total : Int32) : String
Source
page(title, desc, path, content) : String
Source
row(s : Shard) : String
Source
search(q : String, results : Array(Shard), total : Int32, sort : String | Nil = nil, filter5 : Bool = false) : String
Source
search_url(q : String, sort : String | Nil, filter5 : Bool) : String

Query-string builders for sort/filter controls (no-JS, plain links).

Source
shard_page(s : Shard, all : Array(Shard)) : String
Source
sitemap(site : SiteData) : String
Source

Nested types