package main import "io/fs" import "strings" import "github.com/dustin/go-humanize" var siteName = "FollieCDN" templ pageTemplate(path string) { { siteName } if path != "" { } else { }
{ children... }
} templ indexPage() { @pageTemplate("") {

folliehiyuki's personal web assets

Hi! Welcome to my "Content Delivery Network" freeloading running on Cloudflare. The files served here are used to power my websites, including my personal blog and handbook. The source code is available to see on GitLab.

Packages

fonts - Various 3rd-party fonts I use everywhere
styles - Some minimal, opinionated CSS settings

} } templ listingPage(path string, entries []fs.DirEntry) { @pageTemplate(path) {

Directory listing

@splitPathIntoLinks(strings.Split(path, "/"))

for _, entry := range entries { if entry.Name() != "index.html" {
if entry.IsDir() {  } else {   } if entry.IsDir() { { entry.Name() + "/" } } else { { entry.Name() } }
{ func(e fs.DirEntry) string { info, _ := e.Info() return humanize.Bytes(uint64(info.Size())) }(entry) }
} }
} } templ splitPathIntoLinks(pathArr []string) { for index, elem := range pathArr { { " " }{ " " } { elem } } }