uhh
crispy-caesus 114518720+crispy-caesus@users.noreply.github.com
Fri, 01 Nov 2024 13:08:26 +0100
3 files changed,
57 insertions(+),
0 deletions(-)
A
index
A
index.go
@@ -0,0 +1,33 @@
+package main + +import ( + "log" + "net/http" + "html/template" +) + +type Page struct { + Title string + Body []byte +} + +var templates = template.Must(template.ParseFiles("index.html")) + +func renderTemplate(w http.ResponseWriter, tmpl string, p *Page) { + err := templates.ExecuteTemplate(w, tmpl+".html", p) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + } +} + +func viewHandler(w http.ResponseWriter, r *http.Request) { + p := &Page{Title: "index"} + renderTemplate(w, "index", p) +} + + +func main() { + http.HandleFunc("/", viewHandler) + log.Fatal(http.ListenAndServe(":8080", nil)) +} +
A
index.html
@@ -0,0 +1,24 @@
+<title>home</title> + +<body> + <h1>hi</h1> + <p>this is a work in progress (in case you couldn't tell)</p> + <p>I'm an 18 year old student from Germany, aspiring to become a system administrator. I like tinkering around + with my linux and write a little program here and there.</p> + <p>Currently I'm learning a bunch about server monitoring, as part of a school project</p> + + <h2>some links</h2> + <ul> + <li> + <a title="github" href="https://github.com/crispy-caesus" />my github</a> + <p>contains most of my little projects, as well as my dotfiles for my linux configuration</p> + </li> + <li> + <a title="anilist" href="https://anilist.co/user/crispycaesus/" />my anilist</a> + <p>a list of the anime I have watched and plan to watch and some ratings and thoughts on them + </p> + </li> + <li> + <a title="stats.fm" href="https://stats.fm/caesus" />my stats.fm</a> + <p>the music I listened to on spotify (have since switched to tidal)</p> +</body>