diff --git a/docs/hacking.md b/docs/hacking.md index d9f4bf3..da54d0e 100644 --- a/docs/hacking.md +++ b/docs/hacking.md @@ -40,6 +40,7 @@ SHLF_DEV=true go run cmd/server/main.go If you modified the views, you will need to regenerate them: ```bash go tool templ generate +go tool templ fmt ./internal/ui/ ``` If you modified the tailwind styles, you will need to regenerate the css: diff --git a/input.css b/input.css index 55d8ea8..0363007 100644 --- a/input.css +++ b/input.css @@ -1,5 +1,5 @@ @import "tailwindcss"; -@import "./internal/views/shelf/shelf.css"; +@import "./internal/ui/views/shelf/shelf.css"; @theme { --color-ink: #000; diff --git a/internal/atproto/utils.go b/internal/atproto/identity.go similarity index 100% rename from internal/atproto/utils.go rename to internal/atproto/identity.go diff --git a/internal/server/index.go b/internal/server/index.go index e62ab91..84ac6b5 100644 --- a/internal/server/index.go +++ b/internal/server/index.go @@ -3,7 +3,7 @@ package server import ( "net/http" - "shlf.space/internal/views/index" + "shlf.space/internal/ui/views/index" ) func (s *Server) Index(w http.ResponseWriter, r *http.Request) { diff --git a/internal/server/login.go b/internal/server/login.go index e95cd30..fd9425e 100644 --- a/internal/server/login.go +++ b/internal/server/login.go @@ -7,7 +7,7 @@ import ( "strings" "shlf.space/internal/server/htmx" - "shlf.space/internal/views/login" + "shlf.space/internal/ui/views/login" ) func (s *Server) Login(w http.ResponseWriter, r *http.Request) { diff --git a/internal/server/middleware/middleware.go b/internal/server/middleware/middleware.go index b1eb797..6daa809 100644 --- a/internal/server/middleware/middleware.go +++ b/internal/server/middleware/middleware.go @@ -10,7 +10,7 @@ import ( "github.com/go-chi/chi/v5" "shlf.space/internal/atproto" "shlf.space/internal/server/oauth" - notfound "shlf.space/internal/views/not-found" + notfound "shlf.space/internal/ui/views/not-found" ) type CtxKey string diff --git a/internal/server/router.go b/internal/server/router.go index 1958097..c0e14d6 100644 --- a/internal/server/router.go +++ b/internal/server/router.go @@ -7,7 +7,7 @@ import ( "github.com/go-chi/chi/v5" "shlf.space/internal/atproto" "shlf.space/internal/server/middleware" - notfound "shlf.space/internal/views/not-found" + notfound "shlf.space/internal/ui/views/not-found" ) func (s *Server) Router() http.Handler { diff --git a/internal/server/shelf.go b/internal/server/shelf.go index 2903ef5..17c2004 100644 --- a/internal/server/shelf.go +++ b/internal/server/shelf.go @@ -7,7 +7,7 @@ import ( "shlf.space/internal/db" "shlf.space/internal/server/htmx" "shlf.space/internal/types" - "shlf.space/internal/views/shelf" + "shlf.space/internal/ui/views/shelf" ) func (s *Server) Shelf(w http.ResponseWriter, r *http.Request) { diff --git a/internal/components/header/header.go b/internal/ui/components/header/header.go similarity index 100% rename from internal/components/header/header.go rename to internal/ui/components/header/header.go diff --git a/internal/components/header/header.templ b/internal/ui/components/header/header.templ similarity index 100% rename from internal/components/header/header.templ rename to internal/ui/components/header/header.templ diff --git a/internal/layouts/base/base.go b/internal/ui/layouts/base/base.go similarity index 100% rename from internal/layouts/base/base.go rename to internal/ui/layouts/base/base.go diff --git a/internal/layouts/base/base.templ b/internal/ui/layouts/base/base.templ similarity index 100% rename from internal/layouts/base/base.templ rename to internal/ui/layouts/base/base.templ diff --git a/internal/views/index/index.go b/internal/ui/views/index/index.go similarity index 100% rename from internal/views/index/index.go rename to internal/ui/views/index/index.go diff --git a/internal/views/index/index.templ b/internal/ui/views/index/index.templ similarity index 64% rename from internal/views/index/index.templ rename to internal/ui/views/index/index.templ index 11e3e79..8128fdc 100644 --- a/internal/views/index/index.templ +++ b/internal/ui/views/index/index.templ @@ -1,7 +1,9 @@ package index -import "shlf.space/internal/layouts/base" -import "shlf.space/internal/components/header" +import ( + "shlf.space/internal/ui/components/header" + layouts "shlf.space/internal/ui/layouts/base" +) templ IndexPage(params IndexPageParams) { @layouts.Base(layouts.BaseParams{Title: "home"}) { diff --git a/internal/views/login/login.go b/internal/ui/views/login/login.go similarity index 100% rename from internal/views/login/login.go rename to internal/ui/views/login/login.go diff --git a/internal/views/login/login.templ b/internal/ui/views/login/login.templ similarity index 96% rename from internal/views/login/login.templ rename to internal/ui/views/login/login.templ index 56ef423..5915a7c 100644 --- a/internal/views/login/login.templ +++ b/internal/ui/views/login/login.templ @@ -1,6 +1,6 @@ package login -import "shlf.space/internal/layouts/base" +import layouts "shlf.space/internal/ui/layouts/base" templ LoginPage(params LoginPageParams) { @layouts.Base(layouts.BaseParams{Title: "login"}) { diff --git a/internal/views/not-found/not-found.go b/internal/ui/views/not-found/not-found.go similarity index 100% rename from internal/views/not-found/not-found.go rename to internal/ui/views/not-found/not-found.go diff --git a/internal/views/not-found/not-found.templ b/internal/ui/views/not-found/not-found.templ similarity index 76% rename from internal/views/not-found/not-found.templ rename to internal/ui/views/not-found/not-found.templ index 6e705d3..31d3ce9 100644 --- a/internal/views/not-found/not-found.templ +++ b/internal/ui/views/not-found/not-found.templ @@ -1,6 +1,6 @@ package notfound -import "shlf.space/internal/layouts/base" +import layouts "shlf.space/internal/ui/layouts/base" templ NotFoundPage(params NotFoundPageParams) { @layouts.Base(layouts.BaseParams{Title: "not found"}) { diff --git a/internal/views/shelf/shelf.css b/internal/ui/views/shelf/shelf.css similarity index 100% rename from internal/views/shelf/shelf.css rename to internal/ui/views/shelf/shelf.css diff --git a/internal/views/shelf/shelf.go b/internal/ui/views/shelf/shelf.go similarity index 100% rename from internal/views/shelf/shelf.go rename to internal/ui/views/shelf/shelf.go diff --git a/internal/views/shelf/shelf.js b/internal/ui/views/shelf/shelf.js similarity index 100% rename from internal/views/shelf/shelf.js rename to internal/ui/views/shelf/shelf.js diff --git a/internal/views/shelf/shelf.templ b/internal/ui/views/shelf/shelf.templ similarity index 96% rename from internal/views/shelf/shelf.templ rename to internal/ui/views/shelf/shelf.templ index 3b64880..8c5de9e 100644 --- a/internal/views/shelf/shelf.templ +++ b/internal/ui/views/shelf/shelf.templ @@ -2,8 +2,8 @@ package shelf import ( "fmt" - "shlf.space/internal/components/header" - "shlf.space/internal/layouts/base" + "shlf.space/internal/ui/components/header" + layouts "shlf.space/internal/ui/layouts/base" ) templ ShelfPage(params ShelfPageParams) {