|
|
|
@ -8,8 +8,12 @@ import (
|
|
|
|
"net/http"
|
|
|
|
"net/http"
|
|
|
|
"net/url"
|
|
|
|
"net/url"
|
|
|
|
"os"
|
|
|
|
"os"
|
|
|
|
|
|
|
|
_ "embed"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//go:embed styles.css
|
|
|
|
|
|
|
|
var styleSheet string
|
|
|
|
|
|
|
|
|
|
|
|
//easily put attrs in a tag
|
|
|
|
//easily put attrs in a tag
|
|
|
|
type htmlAttrs map[string]string
|
|
|
|
type htmlAttrs map[string]string
|
|
|
|
func (attrs htmlAttrs) String() string {
|
|
|
|
func (attrs htmlAttrs) String() string {
|
|
|
|
@ -109,12 +113,8 @@ func main() {
|
|
|
|
|
|
|
|
|
|
|
|
contents = wrapWithTagAttrs(contents, "div", gridContainerAttrs)
|
|
|
|
contents = wrapWithTagAttrs(contents, "div", gridContainerAttrs)
|
|
|
|
contents = wrapWithTag(contents, "pre")
|
|
|
|
contents = wrapWithTag(contents, "pre")
|
|
|
|
style, err := os.ReadFile("styles.css")
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
contents = wrapWithTag(string(styleSheet), "style") + contents
|
|
|
|
log.Fatal(err)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
contents = wrapWithTag(string(style), "style") + contents
|
|
|
|
|
|
|
|
//contents = wrapWithTag("<link rel=\"stylesheet\" href=\"styles.css\">", "head") + contents
|
|
|
|
|
|
|
|
contents = wrapWithTag(contents, "html")
|
|
|
|
contents = wrapWithTag(contents, "html")
|
|
|
|
contents = "<!DOCTYPE html>" + contents
|
|
|
|
contents = "<!DOCTYPE html>" + contents
|
|
|
|
|
|
|
|
|
|
|
|
|