This commit is contained in:
2026-05-06 23:21:43 +02:00
parent 1634c4cc0d
commit def67b14e4
6 changed files with 24 additions and 115 deletions
+1 -1
View File
@@ -54,4 +54,4 @@ See `.env.example` for all required variables.
## Module Path ## Module Path
`github.com/forgao/forgebucket` `github.com/forgeo/forgebucket`
+3 -3
View File
@@ -14,9 +14,9 @@ import (
"github.com/joho/godotenv" "github.com/joho/godotenv"
_ "github.com/lib/pq" _ "github.com/lib/pq"
"github.com/forgao/forgebucket/internal/api" "github.com/forgeo/forgebucket/internal/api"
"github.com/forgao/forgebucket/internal/config" "github.com/forgeo/forgebucket/internal/config"
"github.com/forgao/forgebucket/web" "github.com/forgeo/forgebucket/web"
) )
func main() { func main() {
+8 -104
View File
@@ -1,111 +1,15 @@
:root { @import "tailwindcss";
--text: #6b6375;
--text-h: #08060d;
--bg: #fff;
--border: #e5e4e7;
--code-bg: #f4f3ec;
--accent: #aa3bff;
--accent-bg: rgba(170, 59, 255, 0.1);
--accent-border: rgba(170, 59, 255, 0.5);
--social-bg: rgba(244, 243, 236, 0.5);
--shadow:
rgba(0, 0, 0, 0.1) 0 10px 15px -3px, rgba(0, 0, 0, 0.05) 0 4px 6px -2px;
--sans: system-ui, 'Segoe UI', Roboto, sans-serif; /* Reset #root to full viewport — Tailwind handles all layout via utility classes */
--heading: system-ui, 'Segoe UI', Roboto, sans-serif; body {
--mono: ui-monospace, Consolas, monospace; margin: 0;
font-family: system-ui, 'Segoe UI', Roboto, sans-serif;
font: 18px/145% var(--sans);
letter-spacing: 0.18px;
color-scheme: light dark;
color: var(--text);
background: var(--bg);
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
color: #172B4D;
@media (max-width: 1024px) { background: #FAFBFC;
font-size: 16px;
}
}
@media (prefers-color-scheme: dark) {
:root {
--text: #9ca3af;
--text-h: #f3f4f6;
--bg: #16171d;
--border: #2e303a;
--code-bg: #1f2028;
--accent: #c084fc;
--accent-bg: rgba(192, 132, 252, 0.15);
--accent-border: rgba(192, 132, 252, 0.5);
--social-bg: rgba(47, 48, 58, 0.5);
--shadow:
rgba(0, 0, 0, 0.4) 0 10px 15px -3px, rgba(0, 0, 0, 0.25) 0 4px 6px -2px;
}
#social .button-icon {
filter: invert(1) brightness(2);
}
} }
#root { #root {
width: 1126px; height: 100dvh;
max-width: 100%;
margin: 0 auto;
text-align: center;
border-inline: 1px solid var(--border);
min-height: 100svh;
display: flex;
flex-direction: column;
box-sizing: border-box;
}
body {
margin: 0;
}
h1,
h2 {
font-family: var(--heading);
font-weight: 500;
color: var(--text-h);
}
h1 {
font-size: 56px;
letter-spacing: -1.68px;
margin: 32px 0;
@media (max-width: 1024px) {
font-size: 36px;
margin: 20px 0;
}
}
h2 {
font-size: 24px;
line-height: 118%;
letter-spacing: -0.24px;
margin: 0 0 8px;
@media (max-width: 1024px) {
font-size: 20px;
}
}
p {
margin: 0;
}
code,
.counter {
font-family: var(--mono);
display: inline-flex;
border-radius: 4px;
color: var(--text-h);
}
code {
font-size: 15px;
line-height: 135%;
padding: 4px 8px;
background: var(--code-bg);
} }
+3 -3
View File
@@ -10,9 +10,9 @@ import (
gcsrf "github.com/gorilla/csrf" gcsrf "github.com/gorilla/csrf"
"github.com/gorilla/sessions" "github.com/gorilla/sessions"
"github.com/forgao/forgebucket/internal/api/handlers" "github.com/forgeo/forgebucket/internal/api/handlers"
"github.com/forgao/forgebucket/internal/api/middleware" "github.com/forgeo/forgebucket/internal/api/middleware"
"github.com/forgao/forgebucket/internal/config" "github.com/forgeo/forgebucket/internal/config"
) )
func New(cfg *config.Config, store sessions.Store, staticFiles fs.FS) http.Handler { func New(cfg *config.Config, store sessions.Store, staticFiles fs.FS) http.Handler {
+1 -1
View File
@@ -1,7 +1,7 @@
package migrations package migrations
import ( import (
"github.com/forgao/forgebucket/internal/models" "github.com/forgeo/forgebucket/internal/models"
"xorm.io/xorm" "xorm.io/xorm"
) )
+8 -3
View File
@@ -3,18 +3,23 @@ package web
import ( import (
"embed" "embed"
"io/fs" "io/fs"
"net/http"
) )
//go:embed all:dist //go:embed all:dist
var staticFiles embed.FS var staticFiles embed.FS
// FS returns the embedded frontend/dist subtree. // FS returns the embedded frontend/dist subtree.
// Falls back to an empty FS during development (before `make build` runs).
func FS() fs.FS { func FS() fs.FS {
sub, err := fs.Sub(staticFiles, "dist") sub, err := fs.Sub(staticFiles, "dist")
if err != nil { if err != nil {
return http.FS(http.Dir("")) // dist not present (pre-build); return an empty FS so the server still starts
return emptyFS{}
} }
return sub return sub
} }
type emptyFS struct{}
func (emptyFS) Open(name string) (fs.File, error) {
return nil, &fs.PathError{Op: "open", Path: name, Err: fs.ErrNotExist}
}