]> localhost Git - homepage.git/commitdiff
feat: go
authorJansen <[email protected]>
Sun, 6 Jul 2025 00:17:14 +0000 (20:17 -0400)
committerJansen <[email protected]>
Sun, 6 Jul 2025 00:17:14 +0000 (20:17 -0400)
18 files changed:
Dockerfile [new file with mode: 0644]
cmd/main.go [new file with mode: 0644]
go.mod [new file with mode: 0644]
static/assets/css/blog-post.css [new file with mode: 0644]
static/assets/css/blog.css [new file with mode: 0644]
static/assets/css/index.css [moved from assets/css/index.css with 100% similarity]
static/assets/css/projects.css [moved from assets/css/projects.css with 100% similarity]
static/assets/css/themes/codeclocks.css [moved from assets/css/themes/codeclocks.css with 100% similarity]
static/assets/fonts/JetBrainsMono.ttf [moved from assets/fonts/JetBrainsMono.ttf with 100% similarity]
static/assets/imgs/DrKLvtFUcAE6ExK.jpg [moved from assets/imgs/DrKLvtFUcAE6ExK.jpg with 100% similarity]
static/assets/imgs/kirby-home.png [moved from assets/imgs/kirby-home.png with 100% similarity]
static/assets/imgs/kirby.png [moved from assets/imgs/kirby.png with 100% similarity]
static/assets/imgs/projects-home.png [moved from assets/imgs/projects-home.png with 100% similarity]
static/templates/404.html [moved from 404.html with 100% similarity]
static/templates/blog.html [new file with mode: 0644]
static/templates/blog/you-most-likely-dont-need-aws.html [new file with mode: 0644]
static/templates/index.html [moved from index.html with 98% similarity]
static/templates/projects.html [moved from projects.html with 100% similarity]

diff --git a/Dockerfile b/Dockerfile
new file mode 100644 (file)
index 0000000..b7803bc
--- /dev/null
@@ -0,0 +1,14 @@
+FROM --platform=$BUILDPLATFORM golang:1.24-alpine AS build
+
+ARG TARGETOS
+ARG TARGETARCH
+
+WORKDIR /app
+COPY . .
+RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o server cmd/main.go
+
+# FINAL IMAGE
+
+FROM alpine
+COPY --from=build /app/server /server
+ENTRYPOINT ["/server"]
diff --git a/cmd/main.go b/cmd/main.go
new file mode 100644 (file)
index 0000000..43520f1
--- /dev/null
@@ -0,0 +1,24 @@
+package main
+
+import (
+       "log"
+       "net/http"
+)
+
+func index(w http.ResponseWriter, _ *http.Request) {
+       w.Write([]byte("Hello, from my RPI!"))
+}
+
+func main() {
+       router := http.NewServeMux()
+       router.HandleFunc("/", index)
+
+       server := http.Server {
+               Addr: ":8000",
+               Handler: router,
+       }
+
+       log.Println("Starting server at :8000")
+       server.ListenAndServe()
+}
+
diff --git a/go.mod b/go.mod
new file mode 100644 (file)
index 0000000..a58451a
--- /dev/null
+++ b/go.mod
@@ -0,0 +1,3 @@
+module jsdaj.com/homepage
+
+go 1.24.4
diff --git a/static/assets/css/blog-post.css b/static/assets/css/blog-post.css
new file mode 100644 (file)
index 0000000..c10155b
--- /dev/null
@@ -0,0 +1,56 @@
+@font-face {
+  font-family: 'JetBrains';
+  src: url('../fonts/JetBrainsMono.ttf') format('truetype');
+  font-weight: normal;
+}
+
+/* 
+* =========================================================
+* Common 
+* =========================================================
+* */
+* {
+  margin: 0;
+  padding: 0;
+
+  color: var(--fg2);
+  font-family: JetBrains, monospace;
+}
+
+body {
+  background-color: var(--bg1);
+}
+
+/* 
+* =========================================================
+* Header
+* =========================================================
+* */
+.header {
+  display: flex;
+  margin: 1rem auto;
+  width: 800px;
+  list-style: none;
+  gap: 11rem;
+  align-items: center;
+  margin-bottom: 2rem;
+}
+
+/* 
+* =========================================================
+* Post
+* =========================================================
+* */
+header {
+  width: 800px;
+  margin: 1rem auto;
+}
+
+main {
+  width: 800px;
+  margin: 0 auto;
+  margin-bottom: 2rem;
+}
+
+header {
+}
diff --git a/static/assets/css/blog.css b/static/assets/css/blog.css
new file mode 100644 (file)
index 0000000..436bce2
--- /dev/null
@@ -0,0 +1,80 @@
+@font-face {
+  font-family: 'JetBrains';
+  src: url('../fonts/JetBrainsMono.ttf') format('truetype');
+  font-weight: normal;
+}
+
+/* 
+* =========================================================
+* Common 
+* =========================================================
+* */
+* {
+  margin: 0;
+  padding: 0;
+
+  color: var(--fg2);
+  font-family: JetBrains, monospace;
+}
+
+body {
+  background-color: var(--bg1);
+}
+
+/* 
+* =========================================================
+* Header
+* =========================================================
+* */
+.header {
+  display: flex;
+  margin: 1rem auto;
+  width: 800px;
+  list-style: none;
+  gap: 11rem;
+  align-items: center;
+  margin-bottom: 2rem;
+}
+
+/* 
+* =========================================================
+* Posts
+* =========================================================
+* */
+.post-list {
+  width: 800px;
+  list-style: none;
+  margin: 1rem auto;
+}
+
+.post-link {
+  transition: .1s background-color;
+  display: block;
+  padding: 1rem;
+  border-top: 2px solid var(--bg2);
+  text-decoration: none;
+}
+
+.post-link:hover {
+  border-radius: 8px;
+  background-color: var(--bg2);
+}
+
+.post .post-header {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  margin-bottom: .5rem;
+}
+
+.post .post-header .title {
+  font-size: 20px;
+}
+
+.post .post-header .date {
+  text-decoration: underline;
+}
+
+.post .summary {
+  font-size: 14px;
+}
similarity index 100%
rename from 404.html
rename to static/templates/404.html
diff --git a/static/templates/blog.html b/static/templates/blog.html
new file mode 100644 (file)
index 0000000..8cdd50f
--- /dev/null
@@ -0,0 +1,28 @@
+<!DOCUMENT 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">
+  </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>
+  </body>
+</html>
diff --git a/static/templates/blog/you-most-likely-dont-need-aws.html b/static/templates/blog/you-most-likely-dont-need-aws.html
new file mode 100644 (file)
index 0000000..7bee4ec
--- /dev/null
@@ -0,0 +1,39 @@
+<!DOCUMENT 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">
+  </head>
+  <body>
+    <ul class="header">
+      <li><b><a href="/">Go Back</a></b></li>
+    </ul>
+
+    <header>
+      <h1 class="title">You (most likely) don't need AWS</h1>
+      <p class="date">2025-07-04</p>
+    </header>
+
+    <main>
+      <p>
+        When I first started working as a developer almost 10y ago, you usually had 3 options whenever you needed to
+        deploy a new service: you either manually built an on-premise server locally, or reserve a VM in a data center,
+        or you could do like the cool kids and create an account on AWS and started tweaking. I'm not so sure when or 
+        how, but slowly the first two options rapidly "became obsolete"... except that they didn't?
+      </p>
+
+      <p>
+        I've been thinking about this for quite some time now. Why did we stop doing like the old way? Was it because
+        of costs? Was it because of technical difficulties?
+      </p>
+    </main>
+
+    <ul class="header">
+      <li><b><a href="/">Go Back</a></b></li>
+    </ul>
+  </body>
+</html>
similarity index 98%
rename from index.html
rename to static/templates/index.html
index 38a35d8de2ed5adb442389e2b83dedd0f8f699d5..f3421875c4eb45395bbd9fa32395893b1002d77c 100644 (file)
@@ -75,7 +75,7 @@
     <ul class="useful-links">
       <li><b><a href="/projects.html">Projects Showcase</a></b></li>
       <li>-</li>
-      <li><b><a href="/404.html">Blog</a></b></li>
+      <li><b><a href="/blog.html">Blog</a></b></li>
     </ul>
   </body>
 </html>
similarity index 100%
rename from projects.html
rename to static/templates/projects.html