index — crispy-website @ ec7d350c524596a25470518083385301869a3ad9

My personal homepage (very crispy)

gensite: make html a temporary dir and add init commands
crispy-caesus crispy@crispy-caesus.eu
Sat, 21 Mar 2026 10:44:21 +0100
commit

ec7d350c524596a25470518083385301869a3ad9

parent

90b64a7da4a824f49b8bbeec184f57c0f678ae03

M .gitignore.gitignore

@@ -1,3 +1,3 @@

crispy-website *.db -test +html
M cmd/server/genblog.gocmd/server/genblog.go

@@ -19,10 +19,18 @@ }

) func generateBlog() { + fmt.Println("Generating blog dir...") + genBlogDir() fmt.Println("Generating blog page...") blogDataSlice := generateBlogPage() fmt.Println("Generating blog posts...") generateBlogPosts(blogDataSlice) +} + +func genBlogDir() { + os.RemoveAll("html/blog") + err := os.Mkdir("html/blog", 0o700) + check(err) } func fillLinks(content []byte, post blogData) string {
A cmd/server/gensite.go

@@ -0,0 +1,22 @@

+package main + +import ( + "fmt" + "os" +) + +func genSite() { + fmt.Println("Generating site dirs...") + genSiteDirs() + fmt.Println("Copying over htmls...") + err := copyFile("templates/index.html", "html/index.html") + check(err) + err = copyFile("templates/music.html", "html/music.html") + check(err) +} + +func genSiteDirs() { + os.RemoveAll("html") + err := os.Mkdir("html", 0o700) + check(err) +}
M cmd/server/main.gocmd/server/main.go

@@ -18,9 +18,15 @@ }

func main() { // generate blog pages - if len(os.Args) == 2 && os.Args[1] == "blog" { - generateBlog() - return + if len(os.Args) == 2 { + switch os.Args[1] { + case "init": + genSite() + return + case "blog": + generateBlog() + return + } } fs := http.FileServer(http.Dir("static"))
A cmd/server/util.go

@@ -0,0 +1,43 @@

+package main + +import ( + "fmt" + "io" + "os" +) + +func check(e error) { + if e != nil { + panic(e) + } +} + +func copyFile(src, dst string) error { + // Open the source file + sourceFile, err := os.Open(src) + if err != nil { + return fmt.Errorf("failed to open source file: %w", err) + } + defer sourceFile.Close() + + // Create the destination file + destinationFile, err := os.Create(dst) + if err != nil { + return fmt.Errorf("failed to create destination file: %w", err) + } + defer destinationFile.Close() + + // Copy the content + _, err = io.Copy(destinationFile, sourceFile) + if err != nil { + return fmt.Errorf("failed to copy file: %w", err) + } + + // Flush file metadata to disk + err = destinationFile.Sync() + if err != nil { + return fmt.Errorf("failed to sync destination file: %w", err) + } + + return nil +}
A templates/index.html

@@ -0,0 +1,184 @@

+<!doctype html> +<html lang="en"> + <head> + <meta charset="UTF-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>banana square</title> + <link rel="stylesheet" href="../static/index.css" /> + <link rel="icon" type="image/png" href="../static/banan_icon.png" /> + </head> + + <body> + <div class="outer-container"> + <main class="top"> + <div class="top-left"> + <article class="box container intro"> + <h1>hi</h1> + <img + src="../static/banan.png" + alt="my profile picture" + class="banana-img non-pixelated" + /> + <p> + I'm a 19-year-old university student from Germany, aspiring to + become a system administrator. I like tinkering around with my + Linux systems and write a little program here and there. + </p> + <p> + Currently I am doing my bachelor's in a Duale Hochschule. In my + free time (and potentially <i>sometimes</i> in class) I work on my + homelab and regret all the other projects I started and am lagging + behind in. + </p> + </article> + <div class="small-box container cool-people"> + <b>cool people</b> + <div class="people-buttons"> + <a href="https://crispy-caesus.eu" class="image-site-button" + ><img src="static/crispybutton.png" + /></a> + + <a + class="image-site-button" + href="https://erine.dev/" + target="_blank" + rel="noopener noreferrer" + > + <img + src="https://chibisafe.crispy-caesus.eu/MEkVLB08qVlq.png" + alt="erine-button" + /> + </a> + <a + class="box text-site-button" + href="https://notashelf.dev/" + target="_blank" + rel="noopener noreferrer" + > + raf + </a> + <a + class="box text-site-button" + href="https://tim-niess.com" + target="_blank" + rel="noopener noreferrer" + > + Tim + </a> + <a + class="box text-site-button" + href="https://orangc.net" + target="_blank" + rel="noopener noreferrer" + > + orangc + </a> + </div> + </div> + </div> + <div class="box links"> + <h2>some links</h2> + <ul> + <li> + <a + title="Codeberg" + href="https://codeberg.org/crispy-caesus" + target="_blank" + rel="noopener nofererrer" + >Codeberg</a + > + - crispy-caesus + <p> + Git server where I have most of my little projects, as well as + the dotfiles for my Linux configuration + </p> + </li> + + <li> + <a + title="Anilist" + href="https://anilist.co/user/crispycaesus/" + target="_blank" + rel="noopener nofererrer" + >Anilist</a + > + - crispycaesus + <p> + A list of the anime I have watched, plan to watch and some + ratings and thoughts on them + </p> + </li> + + <li> + <a + title="E-Mail" + href="mailto:crispy@crispy-caesus.eu" + target="_blank" + rel="noopener nofererrer" + > + E-Mail + </a> + - crispy@crispy-caesus.eu + <p> + Probably my preferred communication medium. At least with + <a title="My PGP key" href="static/crispykey.asc">PGP</a>. I + really like its decentralized and independent nature. Besides + the technical stuff, I just enjoy it over than instant + messaging. I prefer writing longer, more thought out messages, + instead of a bunch of small talk with no purpose (not that I + don't do that, but in hindsight it always seems wasteful). + </p> + </li> + + <li> + <a + title="Matrix" + href="https://matrix.to/#/@crispy:crispy-caesus.eu" + target="_blank" + rel="noopener nofererrer" + > + Matrix + </a> + - @crispy:crispy-caesus.eu + <p> + Decentralized instant messaging network/protocol which I like + for well... instant messaging. While it has spaces it's not + really great at managing them, so I can't recommend it for large + communities. Thus I mainly use it for DMs and group chats. + </p> + </li> + + <li> + <a title="toothbrushing music" href="music"> + toothbrushing music + </a> + <br /> + <p> + Over the past months I've created my little legally aquired + library of DRM-free music, which I stream through my navidrome + instance. There are a bunch of reasons why I prefer this way of + aquiring/listening to music, most of which boils down to + independence and artist support. + </p> + </li> + </ul> + </div> + </main> + <footer> + <div class="credits box"> + <p> + Art drawn by the amazing + <a + title="VanillaPunkk Instagram" + href="https://www.instagram.com/vannillapunkk/" + target="_blank" + rel="noopener nofererrer" + >VanillaPunkk</a + > + | Thanks to some friends for helping with the CSS + </p> + </div> + </footer> + </div> + </body> +</html>
A templates/music.html

@@ -0,0 +1,31 @@

+<!doctype html> +<html lang="en"> + <head> + <meta charset="UTF-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>toothbrushing music</title> + <link rel="stylesheet" href="static/music.css" /> + </head> + + <body> + <h1>My bought music</h1> + <a + title="Bandcamp" + href="https://bandcamp.com/crispy-caesus" + target="_blank" + rel="noopener noreferrer" + > + My Bandcamp + </a> + <p> + For the timebeing this page won't exist anymore as I probably lost the DB + in a migration + </p> + <p>I hope I can bring it back at some point</p> + <img + src="static/toothrush.png" + alt="toothbrush vibing" + class="toothbrush-img non-pixelated" + /> + </body> +</html>