// HTML templates for the static site generator
// All templates generate HTML via string concatenation
pub fn htmlHead(title: String, description: String): String =
"
" +
"" + title + " " +
" " +
" " +
" " +
" " +
" " +
" " +
" " +
" " +
" " +
" " +
" " +
" " +
" " +
" " +
" " +
" " +
" " +
"" +
"" +
""
pub fn htmlNav(): String =
" "
pub fn htmlFooter(): String =
""
// Full HTML document wrapper
pub fn htmlDocument(title: String, description: String, body: String): String =
htmlHead(title, description) +
"" +
htmlNav() +
body +
htmlFooter() +
" "
// Individual post/article page
pub fn htmlPostPage(title: String, date: String, tagsHtml: String, content: String): String =
"" +
"
" + title + " " +
"
" +
"
" +
"
" + date + " " +
"
- " +
"
" + tagsHtml + "
" +
"
" +
"
" + content + "
" +
"
"
// Render tag links for a post
pub fn renderTagLinks(tags: List): String =
String.join(List.map(tags, fn(tag: String): String =>
"" + tag + " "
), ", ")
// Section index page (list of posts)
pub fn htmlPostList(sectionTitle: String, postsHtml: String): String =
"" +
"
" + sectionTitle + " " +
"
" +
postsHtml +
"
"
// A single post entry in a list
pub fn htmlPostEntry(title: String, date: String, url: String): String =
""
// Home page with snippets grid
pub fn htmlHomePage(siteTitle: String, snippetsHtml: String): String =
"" + siteTitle + " " +
"" + "Βράνδων Λουκᾶς" + "
" +
"" +
"Bitcoin Lightning Payments @ voltage.cloud " +
"Bitcoin Privacy & Scalability @ payjoin.org. " +
"Love sovereign software & history. " +
"Learning Nix, Elm, Rust, Ancient Greek and Latin. " +
" " +
"" +
snippetsHtml +
"
"
// Snippet card (used on home page)
pub fn htmlSnippetCard(content: String): String =
""
// Tag index page
pub fn htmlTagPage(tagName: String, postsHtml: String): String =
"" +
"
Tag: " + tagName + " " +
"
" +
postsHtml +
"
"