8/4/26 18:34

This commit is contained in:
Eric Christensen
2026-08-04 18:34:18 -07:00
commit cfb3f16f82
13 changed files with 159 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
package pheynnx
import "core:fmt"
import "core:strings"
render_index_page :: proc(s: ^State) -> string {
b: strings.Builder
strings.builder_init(&b)
defer strings.builder_destroy(&b)
strings.write_string(
&b,
`<!DOCTYPE html><html><head>
<title>My Blog</title>
<link rel="preload" href="/static/fonts/InterVariable.woff2" as="font" crossorigin/>
<link rel="preload" href="/static/fonts/GeistMono.ttf" as="font" crossorigin/>`,
)
fmt.sbprintf(&b, `<style>%v</style>`, state.global_css)
strings.write_string(&b, `</head><body>
<main id="content">
<h1>Hello!</h1>`)
fmt.sbprintf(&b, `<h2>%v</h2>`, state.num)
strings.write_string(&b, `</main></body></html>`)
return strings.clone(strings.to_string(b))
}