navid/veinsforge / commit

2d51120562e2

Navid M <navidmomtahen@gmail.com> · 2026-11-27

parents: 7946f29afb88

Browse files at this commit · Download source

all: layout fixes
--- a/internal/web/server.go+++ b/internal/web/server.go@@ -137,7 +137,7 @@ 	s.routes(mux) 	sub, _ := fs.Sub(staticFS, "static") 	fileServer := http.FileServer(http.FS(sub))-	for _, name := range []string{"app.css", "app.js", "favicon.svg"} {+	for _, name := range []string{"app.css", "app.js", "favicon.svg", "veins.png"} { 		mux.Handle("GET /static/"+name, http.StripPrefix("/static/", cacheStatic(fileServer))) 	} 	mux.HandleFunc("GET /healthz", func(w http.ResponseWriter, r *http.Request) {--- a/internal/web/static/favicon.svg+++ b/internal/web/static/favicon.svg@@ -1,6 +1,46 @@-<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64">-  <rect width="64" height="64" fill="#060a12"/>-  <rect x="4" y="4" width="56" height="56" fill="none" stroke="#e5383b" stroke-width="3"/>-  <path d="M15 20 L27 44 L32 34 L37 44 L49 20" fill="none" stroke="#e8edf5" stroke-width="5" stroke-linejoin="bevel"/>-  <rect x="15" y="50" width="34" height="4" fill="#e5383b"/>+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 460" width="500" height="460" fill="none">+  <defs>+    <linearGradient id="veinGrad" x1="0" y1="0" x2="0" y2="1">+      <stop offset="0%" stop-color="#9e1b24" />+      <stop offset="100%" stop-color="#6f0e15" />+    </linearGradient>+  </defs>++  <g stroke="url(#veinGrad)" stroke-width="14" stroke-linecap="round" stroke-linejoin="round">++    <path d="M 112 45 C 145 110, 175 160, 250 322 C 325 160, 355 110, 388 45" />+++    <path d="M 250 432 C 210 380, 192 315, 165 215 C 145 140, 110 85, 65 40" />+    <path d="M 250 432 C 290 380, 308 315, 335 215 C 355 140, 390 85, 435 40" />+++    <path d="M 335 215 C 345 145, 335 95, 305 62" />+++    <path d="M 165 215 C 152 155, 128 138, 92 132" />+    <path d="M 335 215 C 348 155, 372 138, 408 132" />+++    <path d="M 192 315 C 155 298, 125 292, 92 288" />+    <path d="M 308 315 C 345 298, 375 292, 408 288" />+++    <path d="M 216 368 C 165 362, 118 332, 92 288" />+    <path d="M 284 368 C 335 362, 382 332, 408 288" />+++    <path d="M 92 132 C 72 105, 58 88, 45 78" />+    <path d="M 408 132 C 428 105, 442 88, 455 78" />+    <path d="M 92 288 C 68 242, 52 208, 28 192" />+    <path d="M 408 288 C 432 242, 448 208, 472 192" />+  </g>+++  <g fill="url(#veinGrad)">+    <circle cx="92" cy="132" r="16" />+    <circle cx="408" cy="132" r="16" />+    <circle cx="92" cy="288" r="16" />+    <circle cx="408" cy="288" r="16" />+  </g> </svg>Binary files a/internal/web/static/veins.png and b/internal/web/static/veins.png differ--- a/internal/web/templates/layout.html+++ b/internal/web/templates/layout.html@@ -1,65 +1,81 @@ {{define "layout"}} <!doctype html> <html lang="en" data-theme="dark">-<head>-  <meta charset="utf-8">-  <meta name="viewport" content="width=device-width, initial-scale=1">-  <meta name="color-scheme" content="dark light">-  <title>{{.Title}} · {{.SiteName}}</title>-  <meta name="description" content="{{.SiteDesc}}">-  <link rel="icon" href="/static/favicon.svg" type="image/svg+xml">-  <link rel="stylesheet" href="/static/app.css">-  <script src="/static/app.js" defer></script>-</head>-<body>-<a class="skip" href="#main">Skip to content</a>-<header class="site-header">-  <div class="wrap header-inner">-    <a class="brand" href="/">veinsforge</a>-    <nav class="nav" aria-label="Main">+  <head>+    <meta charset="utf-8" />+    <meta name="viewport" content="width=device-width, initial-scale=1" />+    <meta name="color-scheme" content="dark light" />+    <title>{{.Title}} · {{.SiteName}}</title>+    <meta name="description" content="{{.SiteDesc}}" />+    <link rel="icon" href="/static/veins.png" type="image/svg+xml" />+    <link rel="stylesheet" href="/static/app.css" />+    <script src="/static/app.js" defer></script>+  </head>+  <body>+    <a class="skip" href="#main">Skip to content</a>+    <header class="site-header">+      <div class="wrap header-inner">+        <nav class="nav" aria-label="Main">+          <a href="/explore">repositories</a>+          {{if .User}}+          <a href="/new">new</a>+          <a href="/u/{{.User.Username}}">{{.User.Username}}</a>+          <a href="/settings">settings</a>+          {{if .User.IsAdmin}}<a href="/admin">admin</a>{{end}}+          <form method="post" action="/logout" class="inline">+            <input type="hidden" name="csrf" value="{{.CSRF}}" />+            <button type="submit" class="link">sign out</button>+          </form>+          {{else}}+          <a href="/login">sign in</a>+          <a href="/signup">create account</a>+          {{end}}+          <button+            type="button"+            id="theme-toggle"+            class="link theme-toggle"+            aria-label="Toggle colour theme"+            title="Toggle theme"+          >+            theme+          </button>+        </nav>+      </div>+    </header>+    <main id="main" class="wrap">+      {{if .Notice}}+      <p class="flash flash-ok" role="status">{{.Notice}}</p>+      {{end}} {{if .Error}}+      <p class="flash flash-error" role="alert">{{.Error}}</p>+      {{end}} {{template "content" .}}+    </main>+    <footer class="wrap site-footer">+      <span>{{.SiteName}}</span>+      <span>·</span>       <a href="/explore">repositories</a>-      {{if .User}}-        <a href="/new">new</a>-        <a href="/u/{{.User.Username}}">{{.User.Username}}</a>-        <a href="/settings">settings</a>-        {{if .User.IsAdmin}}<a href="/admin">admin</a>{{end}}-        <form method="post" action="/logout" class="inline">-          <input type="hidden" name="csrf" value="{{.CSRF}}">-          <button type="submit" class="link">sign out</button>-        </form>-      {{else}}-        <a href="/login">sign in</a>-        <a href="/signup">create account</a>-      {{end}}-      <button type="button" id="theme-toggle" class="link theme-toggle" aria-label="Toggle colour theme" title="Toggle theme">theme</button>-    </nav>-  </div>-</header>-<main id="main" class="wrap">-  {{if .Notice}}<p class="flash flash-ok" role="status">{{.Notice}}</p>{{end}}-  {{if .Error}}<p class="flash flash-error" role="alert">{{.Error}}</p>{{end}}-  {{template "content" .}}-</main>-<footer class="wrap site-footer">-  <span>{{.SiteName}}</span>-  <span>·</span>-  <a href="/explore">repositories</a>-  <span>·</span>-  <a href="/healthz">status</a>-</footer>-</body>+      <span>·</span>+      <a href="/healthz">status</a>+    </footer>+  </body> </html>-{{end}}--{{define "avatar"}}{{if .}}<img class="avatar avatar-sm" src="{{avatarURL .Username}}" alt="" width="20" height="20" loading="lazy">{{else}}<span class="avatar avatar-sm avatar-empty" aria-hidden="true"></span>{{end}}{{end}}--{{define "repo-list"}}+{{end}} {{define "avatar"}}{{if .}}<img+  class="avatar avatar-sm"+  src="{{avatarURL .Username}}"+  alt=""+  width="20"+  height="20"+  loading="lazy"+/>{{else}}<span class="avatar avatar-sm avatar-empty" aria-hidden="true"></span+>{{end}}{{end}} {{define "repo-list"}} <ul class="repo-list">   {{range .}}   <li>     <a href="{{repoURL .}}">{{.OwnerName}}/{{.Name}}</a>     {{if .Description}}<span class="repo-desc">{{.Description}}</span>{{end}}-    <span class="repo-meta">★ {{.Stars}} · {{.Visibility}}{{if .Archived}} · archived{{end}} · {{timeago .UpdatedAt}}</span>+    <span class="repo-meta"+      >★ {{.Stars}} · {{.Visibility}}{{if .Archived}} · archived{{end}} ·+      {{timeago .UpdatedAt}}</span+    >   </li>   {{else}}   <li class="muted">No repositories.</li>