8/4/26 18:34
This commit is contained in:
+26
@@ -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))
|
||||
}
|
||||
Reference in New Issue
Block a user