package main
import (
+ "html/template"
"log"
"net/http"
-)
+ "os"
-func index(w http.ResponseWriter, _ *http.Request) {
- w.Write([]byte("Hello, from my RPI!"))
-}
+ "jsdaj.com/homepage/pkg/routes"
+)
func main() {
router := http.NewServeMux()
- router.HandleFunc("/", index)
- server := http.Server {
- Addr: ":8000",
+ templateFS := os.DirFS("static/templates")
+
+ templates, err := template.ParseFS(templateFS, "*.html", "blog/*.html")
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ router.HandleFunc("GET /static/assets/{$}", routes.NothingToSee(templates))
+ router.Handle("GET /static/assets/", http.FileServer(http.Dir(".")))
+ router.HandleFunc("GET /projects", routes.Projects(templates))
+ router.HandleFunc("GET /blog/{post}", routes.BlogPost(templates))
+ router.HandleFunc("GET /blog", routes.Blog(templates))
+ router.HandleFunc("GET /{$}", routes.Index(templates))
+ router.HandleFunc("/", routes.NotFound(templates))
+
+ server := http.Server{
+ Addr: ":8000",
Handler: router,
}
log.Println("Starting server at :8000")
server.ListenAndServe()
}
-
--- /dev/null
+package routes
+
+import (
+ "html/template"
+ "log"
+ "net/http"
+)
+
+func NotFound(templ *template.Template) http.HandlerFunc {
+ return func(w http.ResponseWriter, _ *http.Request) {
+ err := templ.ExecuteTemplate(w, "404.html", "")
+ if err != nil {
+ log.Fatal(err)
+ }
+ }
+}
--- /dev/null
+package routes
+
+import (
+ "fmt"
+ "html/template"
+ "log"
+ "net/http"
+)
+
+func BlogPost(templ *template.Template) http.HandlerFunc {
+ return func(w http.ResponseWriter, r *http.Request) {
+ post := r.PathValue("post")
+
+ err := templ.ExecuteTemplate(w, fmt.Sprintf("%s.html", post), "")
+ if err != nil {
+ log.Fatal(err)
+ }
+ }
+}
--- /dev/null
+package routes
+
+import (
+ "html/template"
+ "log"
+ "net/http"
+)
+
+func Blog(templ *template.Template) http.HandlerFunc {
+ return func(w http.ResponseWriter, _ *http.Request) {
+ err := templ.ExecuteTemplate(w, "blog.html", "")
+ if err != nil {
+ log.Fatal(err)
+ }
+ }
+}
--- /dev/null
+package routes
+
+import (
+ "html/template"
+ "log"
+ "net/http"
+)
+
+func Index(templ *template.Template) http.HandlerFunc {
+ return func(w http.ResponseWriter, _ *http.Request) {
+ err := templ.ExecuteTemplate(w, "index.html", "")
+ if err != nil {
+ log.Fatal(err)
+ }
+ }
+}
--- /dev/null
+package routes
+
+import (
+ "html/template"
+ "log"
+ "net/http"
+)
+
+func NothingToSee(templ *template.Template) http.HandlerFunc {
+ return func(w http.ResponseWriter, _ *http.Request) {
+ err := templ.ExecuteTemplate(w, "nothing-to-see.html", "")
+ if err != nil {
+ log.Fatal(err)
+ }
+ }
+}
--- /dev/null
+package routes
+
+import (
+ "html/template"
+ "log"
+ "net/http"
+)
+
+func Projects(templ *template.Template) http.HandlerFunc {
+ return func(w http.ResponseWriter, _ *http.Request) {
+ err := templ.ExecuteTemplate(w, "projects.html", "")
+ if err != nil {
+ log.Fatal(err)
+ }
+ }
+}
background-color: #f0db4f;
color: black;
}
+
+.tag.go {
+ background-color: #00ADD8 ;
+}
-<!DOCUMENT html>
+<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Jansen Saunier</title>
- <link rel="stylesheet" href="assets/css/themes/codeclocks.css">
- <link rel="stylesheet" href="assets/css/index.css">
+ <link rel="stylesheet" href="/static/assets/css/themes/codeclocks.css">
+ <link rel="stylesheet" href="/static/assets/css/index.css">
</head>
<body>
<div id="terminal">
<div class="terminal-line"><i>$</i> show-not-found</div>
<div class="terminal-content">
- <img src="/assets/imgs/kirby.png" alt="kirby" />
+ <img src="/static/assets/imgs/kirby.png" alt="kirby" />
<div class="terminal-lines">
<div class="terminal-line"><b>!!!Hold up there, pal!!!</b></div>
<div class="terminal-line"><i>------------------------</i></div>
-<!DOCUMENT html>
+<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Jansen Saunier</title>
- <link rel="stylesheet" href="assets/css/themes/codeclocks.css">
- <link rel="stylesheet" href="assets/css/blog.css">
+ <link rel="stylesheet" href="static/assets/css/themes/codeclocks.css">
+ <link rel="stylesheet" href="static/assets/css/blog.css">
</head>
<body>
<ul class="header">
<li><b><a href="/">Go Back</a></b></li>
</ul>
- <ul class="post-list">
- <li class="post">
- <a class="post-link" href="/blog/you-most-likely-dont-need-aws.html">
- <div class="post-header">
- <h1 class="title">You (most likely) don't need AWS</h1>
- <p class="date">2025-07-04</p>
- </div>
- <p class="summary">Some thoughts on how (once again) marketing and entrepreneurship destroyed everyone's mind (again).</p>
- </a>
- </li>
- </ul>
+ <h1>WIP</h1>
+
+ <!-- <ul class="post-list"> -->
+ <!-- <li class="post"> -->
+ <!-- <a class="post-link" href="/blog/blog-you-most-likely-dont-need-aws"> -->
+ <!-- <div class="post-header"> -->
+ <!-- <h1 class="title">You (most likely) don't need AWS</h1> -->
+ <!-- <p class="date">2025-07-04</p> -->
+ <!-- </div> -->
+ <!-- <p class="summary">Some thoughts on how (once again) marketing and entrepreneurship destroyed everyone's mind (again).</p> -->
+ <!-- </a> -->
+ <!-- </li> -->
+ <!-- </ul> -->
</body>
</html>
-<!DOCUMENT html>
+<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Jansen Saunier</title>
- <link rel="stylesheet" href="/assets/css/themes/codeclocks.css">
- <link rel="stylesheet" href="/assets/css/blog-post.css">
+ <link rel="stylesheet" href="/static/assets/css/themes/codeclocks.css">
+ <link rel="stylesheet" href="/static/assets/css/blog-post.css">
</head>
<body>
<ul class="header">
- <li><b><a href="/">Go Back</a></b></li>
+ <li><b><a href="/blog">Go Back</a></b></li>
</ul>
<header>
</main>
<ul class="header">
- <li><b><a href="/">Go Back</a></b></li>
+ <li><b><a href="/blog">Go Back</a></b></li>
</ul>
</body>
</html>
-<!DOCUMENT html>
+<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Jansen Saunier</title>
- <link rel="stylesheet" href="assets/css/themes/codeclocks.css">
- <link rel="stylesheet" href="assets/css/index.css">
+ <link rel="stylesheet" href="static/assets/css/themes/codeclocks.css">
+ <link rel="stylesheet" href="static/assets/css/index.css">
</head>
<body>
<div id="terminal">
<div class="terminal-line"><i>$</i> fastfetch</div>
<div class="terminal-content">
- <img src="/assets/imgs/kirby-home.png" alt="kirby" />
+ <img src="static/assets/imgs/kirby-home.png" alt="kirby" />
<div class="terminal-lines">
<div class="terminal-line"><b>jj</b>@<i>jsdaj.com</i></div>
<div class="terminal-line">------------</div>
</div>
<p class="ascii-source">img src @ <a target="_blank" href="https://www.reddit.com/r/powerscales/comments/1hispp8/kirby_vs_medaka_kurokami_who_wins_and_why/?tl=pt-br">reddit</a></p>
<ul class="useful-links">
- <li><b><a href="/projects.html">Projects Showcase</a></b></li>
+ <li><b><a href="/projects">Projects Showcase</a></b></li>
<li>-</li>
- <li><b><a href="/blog.html">Blog</a></b></li>
+ <li><b><a href="/blog">Blog</a></b></li>
</ul>
</body>
</html>
--- /dev/null
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <title>Jansen Saunier</title>
+
+ <link rel="stylesheet" href="/static/assets/css/themes/codeclocks.css">
+ <link rel="stylesheet" href="/static/assets/css/index.css">
+ </head>
+
+ <body>
+ <div id="terminal">
+ <div class="terminal-line"><i>$</i> nothing-to-see</div>
+ <div class="terminal-content">
+ <img src="/static/assets/imgs/nothing-to-see.png" alt="meta-knight" />
+ <div class="terminal-lines">
+ <div class="terminal-line"><b>!!! OBJECTION !!!</b></div>
+ <div class="terminal-line"><i>------------------------</i></div>
+ <br />
+ <div class="terminal-line">You sure know what you're doing, right?</div>
+ <div class="terminal-line">And you also know you weren't supposed to be here, right?</div>
+ <br />
+ <div class="terminal-line">Instead of poking around just check the <a href="https://codeberg.org/jansen44/homepage">code here.</a></div>
+ <div class="terminal-line">(You'll probably die from boredom anyway...)</div>
+ <br />
+ <div class="terminal-line">
+ My suggestion is try to find something else to <a href="/projects">play here</a> (some of my projects had you in mind with some hidden CTFs (something like this one, but not so obvious), so <a target="_blank" href="mailto:
[email protected]?subject=I'm smarter than you">let me know</a> if you find anything :D)
+ </div>
+ </div>
+ </div>
+ <div class="terminal-line"><i>$</i></div>
+ </div>
+ <p class="ascii-source">img src @ <a target="_blank" href="https://static.wikia.nocookie.net/aceattorney/images/a/a2/AA1_Phoenix_Point.png/revision/latest?cb=20250510212524">pngitem</a></p>
+ <ul class="useful-links">
+ <li><b><a href="/">Go Back</a></b></li>
+ </ul>
+ </body>
+</html>
-<!DOCUMENT html>
+<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Jansen Saunier</title>
- <link rel="stylesheet" href="assets/css/themes/codeclocks.css">
- <link rel="stylesheet" href="assets/css/projects.css">
+ <link rel="stylesheet" href="static/assets/css/themes/codeclocks.css">
+ <link rel="stylesheet" href="static/assets/css/projects.css">
</head>
<body>
<ul class="header">
</p>
<div class="content">
- <a href="https://jsdaj.com" class="project-card" id="project-home">
- <img src="assets/imgs/projects-home.png" alt="home-project-img" />
+ <a href="https://codeberg.org/jansen44/homepage" class="project-card" id="project-home">
+ <img src="static/assets/imgs/projects-home.png" alt="home-project-img" />
<div class="info">
<p class="title">My Personal Website </p>
<p class="description">A personal website as simple as I could do. Simple and static stuff is so charming, don't you think?</p>
<div class="tags">
<p class="tag html">#html</p>
<p class="tag css">#css</p>
- <p class="tag js">#js</p>
+ <p class="tag go">#go</p>
<p class="tag no-ai-code">#ai-code-free</p>
<p class="tag ai-free">#ai-free</p>
</div>