File tree Expand file tree Collapse file tree 3 files changed +18
-5
lines changed
Expand file tree Collapse file tree 3 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -8,14 +8,14 @@ require (
88)
99
1010require (
11+ github.com/anthdm/gothkit v0.0.0-20240608092625-85a106b8717c
1112 github.com/fatih/color v1.16.0 // indirect
1213 github.com/mattn/go-colorable v0.1.13 // indirect
1314 github.com/mattn/go-isatty v0.0.20 // indirect
1415)
1516
1617require (
1718 github.com/a-h/templ v0.2.707
18- github.com/anthdm/gothkit v0.0.0-20240608091251-8198dfa775c8
1919 github.com/go-chi/chi/v5 v5.0.12
2020 github.com/jinzhu/inflection v1.0.0 // indirect
2121 github.com/joho/godotenv v1.5.1
@@ -26,3 +26,8 @@ require (
2626 github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
2727 golang.org/x/sys v0.19.0 // indirect
2828)
29+
30+ // Uncomment this if you are working directly on the core gothkit repo.
31+ // This will directly reflect changes you've made in the gothkit core repo
32+ // to the bootstrap folder.
33+ // replace github.com/anthdm/gothkit => ../
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ github.com/a-h/templ v0.2.707 h1:T1Gkd2ugbRglZ9rYw/VBchWOSZVKmetDbBkm4YubM7U=
22github.com/a-h/templ v0.2.707 /go.mod h1:5cqsugkq9IerRNucNsI4DEamdHPsoGMQy99DzydLhM8 =
33github.com/anthdm/gothkit v0.0.0-20240608091251-8198dfa775c8 h1:2C+WGVrNvIiSLFLJRRgKasJ8aWXR2pfsOh3T5flcMwI =
44github.com/anthdm/gothkit v0.0.0-20240608091251-8198dfa775c8 /go.mod h1:/zW/YMI9hOvRTQwmpfRU+CoJ+m4LZYuzC496KFOJAM8 =
5+ github.com/anthdm/gothkit v0.0.0-20240608092625-85a106b8717c h1:JYV/co6zKfSR4eR/MVORi6wQvva1tikbBS8Xgd2GVFc =
6+ github.com/anthdm/gothkit v0.0.0-20240608092625-85a106b8717c /go.mod h1:/zW/YMI9hOvRTQwmpfRU+CoJ+m4LZYuzC496KFOJAM8 =
57github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c =
68github.com/davecgh/go-spew v1.1.1 /go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38 =
79github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM =
Original file line number Diff line number Diff line change @@ -5,17 +5,22 @@ import (
55 "fmt"
66 "net/url"
77
8- "github.com/a-h/templ"
98 "github.com/anthdm/gothkit/kit"
109 "github.com/anthdm/gothkit/kit/middleware"
1110)
1211
13- func Asset (name string ) templ.SafeURL {
14- return templ .URL (fmt .Sprintf ("/public/assets/%s" , name ))
12+ // Asset is view helper that returns the full asset path as a
13+ // string based on the given asset name.
14+ //
15+ // view.Asset("styles.css") // => /public/assets/styles.css.
16+ func Asset (name string ) string {
17+ return fmt .Sprintf ("/public/assets/%s" , name )
1518}
1619
1720// Auth is a view helper function that returns the current Auth.
1821// If Auth is not set a default auth will be returned
22+ //
23+ // view.Auth(ctx)
1924func Auth (ctx context.Context ) kit.Auth {
2025 value , ok := ctx .Value (kit.AuthKey {}).(kit.Auth )
2126 if ! ok {
@@ -26,7 +31,8 @@ func Auth(ctx context.Context) kit.Auth {
2631
2732// URL is a view helper that returns the current URL.
2833// The request path can be acccessed with:
29- // view.URL(ctx).Path
34+ //
35+ // view.URL(ctx).Path // => ex. /login
3036func URL (ctx context.Context ) * url.URL {
3137 value , ok := ctx .Value (middleware.RequestURLKey {}).(* url.URL )
3238 if ! ok {
You can’t perform that action at this time.
0 commit comments