this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

need the gen code for deployment

+554 -2
-2
.gitignore
··· 5 5 /tmp/ 6 6 7 7 .DS_Store 8 - 9 - *_templ.go
+52
frontend/base_templ.go
··· 1 + // Code generated by templ - DO NOT EDIT. 2 + 3 + // templ: version: v0.2.793 4 + package frontend 5 + 6 + //lint:file-ignore SA4006 This context is only used if a nested component is present. 7 + 8 + import "github.com/a-h/templ" 9 + import templruntime "github.com/a-h/templ/runtime" 10 + 11 + func Base() templ.Component { 12 + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { 13 + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context 14 + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { 15 + return templ_7745c5c3_CtxErr 16 + } 17 + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) 18 + if !templ_7745c5c3_IsBuffer { 19 + defer func() { 20 + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) 21 + if templ_7745c5c3_Err == nil { 22 + templ_7745c5c3_Err = templ_7745c5c3_BufErr 23 + } 24 + }() 25 + } 26 + ctx = templ.InitializeContext(ctx) 27 + templ_7745c5c3_Var1 := templ.GetChildren(ctx) 28 + if templ_7745c5c3_Var1 == nil { 29 + templ_7745c5c3_Var1 = templ.NopComponent 30 + } 31 + ctx = templ.ClearChildren(ctx) 32 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!doctype html><html lang=\"en\"><head><title>Redirecter</title><link rel=\"icon\" type=\"image/x-icon\" href=\"/public/favicon.ico\"><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><link href=\"/public/styles.css\" rel=\"stylesheet\"><script defer src=\"https://unpkg.com/alpinejs@3.x.x/dist/cdn.min.js\"></script><script src=\"https://unpkg.com/htmx.org\"></script><script src=\"https://unpkg.com/htmx.org@1.9.9\" defer></script><script src=\"https://unpkg.com/htmx.org@1.9.12/dist/ext/json-enc.js\"></script></head><body class=\"antialiased\">") 33 + if templ_7745c5c3_Err != nil { 34 + return templ_7745c5c3_Err 35 + } 36 + templ_7745c5c3_Err = Nav().Render(ctx, templ_7745c5c3_Buffer) 37 + if templ_7745c5c3_Err != nil { 38 + return templ_7745c5c3_Err 39 + } 40 + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) 41 + if templ_7745c5c3_Err != nil { 42 + return templ_7745c5c3_Err 43 + } 44 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</body></html>") 45 + if templ_7745c5c3_Err != nil { 46 + return templ_7745c5c3_Err 47 + } 48 + return templ_7745c5c3_Err 49 + }) 50 + } 51 + 52 + var _ = templruntime.GeneratedTemplate
+180
frontend/home_templ.go
··· 1 + // Code generated by templ - DO NOT EDIT. 2 + 3 + // templ: version: v0.2.793 4 + package frontend 5 + 6 + //lint:file-ignore SA4006 This context is only used if a nested component is present. 7 + 8 + import "github.com/a-h/templ" 9 + import templruntime "github.com/a-h/templ/runtime" 10 + 11 + func Home() templ.Component { 12 + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { 13 + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context 14 + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { 15 + return templ_7745c5c3_CtxErr 16 + } 17 + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) 18 + if !templ_7745c5c3_IsBuffer { 19 + defer func() { 20 + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) 21 + if templ_7745c5c3_Err == nil { 22 + templ_7745c5c3_Err = templ_7745c5c3_BufErr 23 + } 24 + }() 25 + } 26 + ctx = templ.InitializeContext(ctx) 27 + templ_7745c5c3_Var1 := templ.GetChildren(ctx) 28 + if templ_7745c5c3_Var1 == nil { 29 + templ_7745c5c3_Var1 = templ.NopComponent 30 + } 31 + ctx = templ.ClearChildren(ctx) 32 + templ_7745c5c3_Err = Base().Render(ctx, templ_7745c5c3_Buffer) 33 + if templ_7745c5c3_Err != nil { 34 + return templ_7745c5c3_Err 35 + } 36 + return templ_7745c5c3_Err 37 + }) 38 + } 39 + 40 + func Account() templ.Component { 41 + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { 42 + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context 43 + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { 44 + return templ_7745c5c3_CtxErr 45 + } 46 + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) 47 + if !templ_7745c5c3_IsBuffer { 48 + defer func() { 49 + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) 50 + if templ_7745c5c3_Err == nil { 51 + templ_7745c5c3_Err = templ_7745c5c3_BufErr 52 + } 53 + }() 54 + } 55 + ctx = templ.InitializeContext(ctx) 56 + templ_7745c5c3_Var2 := templ.GetChildren(ctx) 57 + if templ_7745c5c3_Var2 == nil { 58 + templ_7745c5c3_Var2 = templ.NopComponent 59 + } 60 + ctx = templ.ClearChildren(ctx) 61 + templ_7745c5c3_Err = Base().Render(ctx, templ_7745c5c3_Buffer) 62 + if templ_7745c5c3_Err != nil { 63 + return templ_7745c5c3_Err 64 + } 65 + return templ_7745c5c3_Err 66 + }) 67 + } 68 + 69 + func Something(name, email string) templ.Component { 70 + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { 71 + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context 72 + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { 73 + return templ_7745c5c3_CtxErr 74 + } 75 + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) 76 + if !templ_7745c5c3_IsBuffer { 77 + defer func() { 78 + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) 79 + if templ_7745c5c3_Err == nil { 80 + templ_7745c5c3_Err = templ_7745c5c3_BufErr 81 + } 82 + }() 83 + } 84 + ctx = templ.InitializeContext(ctx) 85 + templ_7745c5c3_Var3 := templ.GetChildren(ctx) 86 + if templ_7745c5c3_Var3 == nil { 87 + templ_7745c5c3_Var3 = templ.NopComponent 88 + } 89 + ctx = templ.ClearChildren(ctx) 90 + templ_7745c5c3_Err = Base().Render(ctx, templ_7745c5c3_Buffer) 91 + if templ_7745c5c3_Err != nil { 92 + return templ_7745c5c3_Err 93 + } 94 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"relative flex justify-center overflow-hidden bg-gray-50 py-6 sm:py-12\"><div class=\"flex-1 mx-auto w-full max-w-md bg-white px-6 pt-6 pb-6 shadow-xl ring-1 ring-gray-900/5 sm:rounded-xl sm:px-8\"><div class=\"w-full\"><div class=\"text-center\"><h1 class=\"text-3xl font-semibold text-gray-900\">Your username is</h1><p class=\"mt-2 text-gray-500\">") 95 + if templ_7745c5c3_Err != nil { 96 + return templ_7745c5c3_Err 97 + } 98 + var templ_7745c5c3_Var4 string 99 + templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(name) 100 + if templ_7745c5c3_Err != nil { 101 + return templ.Error{Err: templ_7745c5c3_Err, FileName: `frontend/home.templ`, Line: 18, Col: 41} 102 + } 103 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) 104 + if templ_7745c5c3_Err != nil { 105 + return templ_7745c5c3_Err 106 + } 107 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</p></div><div class=\"text-center\"><h1 class=\"text-3xl font-semibold text-gray-900\">Your email is</h1><p class=\"mt-2 text-gray-500\">") 108 + if templ_7745c5c3_Err != nil { 109 + return templ_7745c5c3_Err 110 + } 111 + var templ_7745c5c3_Var5 string 112 + templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(email) 113 + if templ_7745c5c3_Err != nil { 114 + return templ.Error{Err: templ_7745c5c3_Err, FileName: `frontend/home.templ`, Line: 22, Col: 42} 115 + } 116 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) 117 + if templ_7745c5c3_Err != nil { 118 + return templ_7745c5c3_Err 119 + } 120 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</p></div></div></div><div class=\"flex-1 mx-auto w-full max-w-md bg-white px-6 pt-6 pb-6 shadow-xl ring-1 ring-gray-900/5 sm:rounded-xl sm:px-8\"><div class=\"w-full\"><div class=\"text-center\"><h1 class=\"text-3xl font-semibold text-gray-900\">Your username is</h1><p class=\"mt-2 text-gray-500\">") 121 + if templ_7745c5c3_Err != nil { 122 + return templ_7745c5c3_Err 123 + } 124 + var templ_7745c5c3_Var6 string 125 + templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(name) 126 + if templ_7745c5c3_Err != nil { 127 + return templ.Error{Err: templ_7745c5c3_Err, FileName: `frontend/home.templ`, Line: 30, Col: 41} 128 + } 129 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) 130 + if templ_7745c5c3_Err != nil { 131 + return templ_7745c5c3_Err 132 + } 133 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</p></div><div class=\"text-center\"><h1 class=\"text-3xl font-semibold text-gray-900\">Your email is</h1><p class=\"mt-2 text-gray-500\">") 134 + if templ_7745c5c3_Err != nil { 135 + return templ_7745c5c3_Err 136 + } 137 + var templ_7745c5c3_Var7 string 138 + templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(email) 139 + if templ_7745c5c3_Err != nil { 140 + return templ.Error{Err: templ_7745c5c3_Err, FileName: `frontend/home.templ`, Line: 34, Col: 42} 141 + } 142 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) 143 + if templ_7745c5c3_Err != nil { 144 + return templ_7745c5c3_Err 145 + } 146 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</p></div></div></div><div class=\"flex-1 mx-auto w-full max-w-md bg-white px-6 pt-6 pb-6 shadow-xl ring-1 ring-gray-900/5 sm:rounded-xl sm:px-8\"><div class=\"w-full\"><div class=\"text-center\"><h1 class=\"text-3xl font-semibold text-gray-900\">Your username is</h1><p class=\"mt-2 text-gray-500\">") 147 + if templ_7745c5c3_Err != nil { 148 + return templ_7745c5c3_Err 149 + } 150 + var templ_7745c5c3_Var8 string 151 + templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(name) 152 + if templ_7745c5c3_Err != nil { 153 + return templ.Error{Err: templ_7745c5c3_Err, FileName: `frontend/home.templ`, Line: 42, Col: 41} 154 + } 155 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) 156 + if templ_7745c5c3_Err != nil { 157 + return templ_7745c5c3_Err 158 + } 159 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</p></div><div class=\"text-center\"><h1 class=\"text-3xl font-semibold text-gray-900\">Your email is</h1><p class=\"mt-2 text-gray-500\">") 160 + if templ_7745c5c3_Err != nil { 161 + return templ_7745c5c3_Err 162 + } 163 + var templ_7745c5c3_Var9 string 164 + templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(email) 165 + if templ_7745c5c3_Err != nil { 166 + return templ.Error{Err: templ_7745c5c3_Err, FileName: `frontend/home.templ`, Line: 46, Col: 42} 167 + } 168 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) 169 + if templ_7745c5c3_Err != nil { 170 + return templ_7745c5c3_Err 171 + } 172 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</p></div></div></div></div>") 173 + if templ_7745c5c3_Err != nil { 174 + return templ_7745c5c3_Err 175 + } 176 + return templ_7745c5c3_Err 177 + }) 178 + } 179 + 180 + var _ = templruntime.GeneratedTemplate
+109
frontend/login_templ.go
··· 1 + // Code generated by templ - DO NOT EDIT. 2 + 3 + // templ: version: v0.2.793 4 + package frontend 5 + 6 + //lint:file-ignore SA4006 This context is only used if a nested component is present. 7 + 8 + import "github.com/a-h/templ" 9 + import templruntime "github.com/a-h/templ/runtime" 10 + 11 + func Login(handle, errorMsg string) templ.Component { 12 + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { 13 + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context 14 + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { 15 + return templ_7745c5c3_CtxErr 16 + } 17 + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) 18 + if !templ_7745c5c3_IsBuffer { 19 + defer func() { 20 + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) 21 + if templ_7745c5c3_Err == nil { 22 + templ_7745c5c3_Err = templ_7745c5c3_BufErr 23 + } 24 + }() 25 + } 26 + ctx = templ.InitializeContext(ctx) 27 + templ_7745c5c3_Var1 := templ.GetChildren(ctx) 28 + if templ_7745c5c3_Var1 == nil { 29 + templ_7745c5c3_Var1 = templ.NopComponent 30 + } 31 + ctx = templ.ClearChildren(ctx) 32 + templ_7745c5c3_Err = Base().Render(ctx, templ_7745c5c3_Buffer) 33 + if templ_7745c5c3_Err != nil { 34 + return templ_7745c5c3_Err 35 + } 36 + templ_7745c5c3_Err = LoginForm("", "").Render(ctx, templ_7745c5c3_Buffer) 37 + if templ_7745c5c3_Err != nil { 38 + return templ_7745c5c3_Err 39 + } 40 + return templ_7745c5c3_Err 41 + }) 42 + } 43 + 44 + func LoginForm(handle, errorMsg string) templ.Component { 45 + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { 46 + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context 47 + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { 48 + return templ_7745c5c3_CtxErr 49 + } 50 + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) 51 + if !templ_7745c5c3_IsBuffer { 52 + defer func() { 53 + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) 54 + if templ_7745c5c3_Err == nil { 55 + templ_7745c5c3_Err = templ_7745c5c3_BufErr 56 + } 57 + }() 58 + } 59 + ctx = templ.InitializeContext(ctx) 60 + templ_7745c5c3_Var2 := templ.GetChildren(ctx) 61 + if templ_7745c5c3_Var2 == nil { 62 + templ_7745c5c3_Var2 = templ.NopComponent 63 + } 64 + ctx = templ.ClearChildren(ctx) 65 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<form class=\"h-screen flex items-center justify-center\" id=\"login-form\" hx-swap=\"outerHTML\" hx-post=\"/login\" hx-ext=\"json-enc\"><div class=\"w-full max-w-sm\"><div class=\"md:flex md:items-center mb-6\"><div class=\"md:w-1/3\"><label class=\"block text-gray-500 font-bold md:text-right mb-1 md:mb-0 pr-4\" for=\"handle\">Bsky Handle</label></div><div class=\"md:w-2/3\"><input class=\"bg-gray-200 appearance-none border-2 border-gray-200 rounded w-full py-2 px-4 text-gray-700 leading-tight focus:outline-none focus:bg-white focus:border-blue-500\" id=\"handle\" name=\"handle\" type=\"text\" value=\"") 66 + if templ_7745c5c3_Err != nil { 67 + return templ_7745c5c3_Err 68 + } 69 + var templ_7745c5c3_Var3 string 70 + templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(handle) 71 + if templ_7745c5c3_Err != nil { 72 + return templ.Error{Err: templ_7745c5c3_Err, FileName: `frontend/login.templ`, Line: 18, Col: 234} 73 + } 74 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) 75 + if templ_7745c5c3_Err != nil { 76 + return templ_7745c5c3_Err 77 + } 78 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"></div></div><div class=\"md:flex md:items-center mb-6\"><div class=\"md:w-1/3\"><label class=\"block text-gray-500 font-bold md:text-right mb-1 md:mb-0 pr-4\" for=\"appPassword\">App Password</label></div><div class=\"md:w-2/3\"><input class=\"bg-gray-200 appearance-none border-2 border-gray-200 rounded w-full py-2 px-4 text-gray-700 leading-tight focus:outline-none focus:bg-white focus:border-blue-500\" id=\"appPassword\" name=\"appPassword\" type=\"password\"></div></div><div class=\"md:flex md:items-center\"><div class=\"md:w-1/3\"></div><div class=\"md:w-1/3\"><button class=\"shadow bg-blue-500 hover:bg-blue-400 focus:shadow-outline focus:outline-none text-white font-bold py-2 px-4 rounded\" type=\"submit\" form=\"login-form\">Login</button></div>") 79 + if templ_7745c5c3_Err != nil { 80 + return templ_7745c5c3_Err 81 + } 82 + if errorMsg != "" { 83 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"md:w-1/3\" id=\"error-message\"><label class=\"text-red-500 font-bold\">") 84 + if templ_7745c5c3_Err != nil { 85 + return templ_7745c5c3_Err 86 + } 87 + var templ_7745c5c3_Var4 string 88 + templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(errorMsg) 89 + if templ_7745c5c3_Err != nil { 90 + return templ.Error{Err: templ_7745c5c3_Err, FileName: `frontend/login.templ`, Line: 41, Col: 17} 91 + } 92 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) 93 + if templ_7745c5c3_Err != nil { 94 + return templ_7745c5c3_Err 95 + } 96 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</label></div>") 97 + if templ_7745c5c3_Err != nil { 98 + return templ_7745c5c3_Err 99 + } 100 + } 101 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div></form>") 102 + if templ_7745c5c3_Err != nil { 103 + return templ_7745c5c3_Err 104 + } 105 + return templ_7745c5c3_Err 106 + }) 107 + } 108 + 109 + var _ = templruntime.GeneratedTemplate
+74
frontend/nav_templ.go
··· 1 + // Code generated by templ - DO NOT EDIT. 2 + 3 + // templ: version: v0.2.793 4 + package frontend 5 + 6 + //lint:file-ignore SA4006 This context is only used if a nested component is present. 7 + 8 + import "github.com/a-h/templ" 9 + import templruntime "github.com/a-h/templ/runtime" 10 + 11 + type contextKey string 12 + 13 + const ( 14 + ContextUsernameKey contextKey = "context_username" 15 + ) 16 + 17 + func Nav() templ.Component { 18 + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { 19 + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context 20 + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { 21 + return templ_7745c5c3_CtxErr 22 + } 23 + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) 24 + if !templ_7745c5c3_IsBuffer { 25 + defer func() { 26 + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) 27 + if templ_7745c5c3_Err == nil { 28 + templ_7745c5c3_Err = templ_7745c5c3_BufErr 29 + } 30 + }() 31 + } 32 + ctx = templ.InitializeContext(ctx) 33 + templ_7745c5c3_Var1 := templ.GetChildren(ctx) 34 + if templ_7745c5c3_Var1 == nil { 35 + templ_7745c5c3_Var1 = templ.NopComponent 36 + } 37 + ctx = templ.ClearChildren(ctx) 38 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<header class=\"header sticky top-0 bg-white shadow-md flex items-center justify-between px-8 py-02\"><nav class=\"nav font-semibold text-lg\"><ul class=\"flex items-center\"><li class=\"p-4 text-blue-500 hover:text-blue-800\"><a href=\"/\">Home</a></li><li class=\"p-4 text-blue-500 hover:text-blue-800\"><a href=\"\">Something</a></li><li class=\"p-4 text-blue-500 hover:text-blue-800\"><a href=\"\">Hello</a></li></ul></nav><div class=\"w-3/12 flex justify-end\"><div class=\"p-4 text-blue-500 hover:text-blue-800\">") 39 + if templ_7745c5c3_Err != nil { 40 + return templ_7745c5c3_Err 41 + } 42 + if username, ok := ctx.Value(ContextUsernameKey).(string); ok { 43 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a class=\"text-right\" href=\"/account\">") 44 + if templ_7745c5c3_Err != nil { 45 + return templ_7745c5c3_Err 46 + } 47 + var templ_7745c5c3_Var2 string 48 + templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(username) 49 + if templ_7745c5c3_Err != nil { 50 + return templ.Error{Err: templ_7745c5c3_Err, FileName: `frontend/nav.templ`, Line: 27, Col: 53} 51 + } 52 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) 53 + if templ_7745c5c3_Err != nil { 54 + return templ_7745c5c3_Err 55 + } 56 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</a>") 57 + if templ_7745c5c3_Err != nil { 58 + return templ_7745c5c3_Err 59 + } 60 + } else { 61 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<a class=\"text-right\" href=\"/account\">Account </a>") 62 + if templ_7745c5c3_Err != nil { 63 + return templ_7745c5c3_Err 64 + } 65 + } 66 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div></div></header>") 67 + if templ_7745c5c3_Err != nil { 68 + return templ_7745c5c3_Err 69 + } 70 + return templ_7745c5c3_Err 71 + }) 72 + } 73 + 74 + var _ = templruntime.GeneratedTemplate
+139
frontend/subscriptions_templ.go
··· 1 + // Code generated by templ - DO NOT EDIT. 2 + 3 + // templ: version: v0.2.793 4 + package frontend 5 + 6 + //lint:file-ignore SA4006 This context is only used if a nested component is present. 7 + 8 + import "github.com/a-h/templ" 9 + import templruntime "github.com/a-h/templ/runtime" 10 + 11 + import ( 12 + "fmt" 13 + "github.com/willdot/bskyfeedgen/store" 14 + ) 15 + 16 + func Subscriptions(errorMsg string, subscriptions []store.Subscription) templ.Component { 17 + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { 18 + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context 19 + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { 20 + return templ_7745c5c3_CtxErr 21 + } 22 + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) 23 + if !templ_7745c5c3_IsBuffer { 24 + defer func() { 25 + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) 26 + if templ_7745c5c3_Err == nil { 27 + templ_7745c5c3_Err = templ_7745c5c3_BufErr 28 + } 29 + }() 30 + } 31 + ctx = templ.InitializeContext(ctx) 32 + templ_7745c5c3_Var1 := templ.GetChildren(ctx) 33 + if templ_7745c5c3_Var1 == nil { 34 + templ_7745c5c3_Var1 = templ.NopComponent 35 + } 36 + ctx = templ.ClearChildren(ctx) 37 + templ_7745c5c3_Err = Base().Render(ctx, templ_7745c5c3_Buffer) 38 + if templ_7745c5c3_Err != nil { 39 + return templ_7745c5c3_Err 40 + } 41 + if errorMsg != "" { 42 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div role=\"alert\"><div class=\"border border-t-0 border-red-400 rounded-b bg-red-100 px-4 py-3 text-red-700\"><p>") 43 + if templ_7745c5c3_Err != nil { 44 + return templ_7745c5c3_Err 45 + } 46 + var templ_7745c5c3_Var2 string 47 + templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(errorMsg) 48 + if templ_7745c5c3_Err != nil { 49 + return templ.Error{Err: templ_7745c5c3_Err, FileName: `frontend/subscriptions.templ`, Line: 13, Col: 17} 50 + } 51 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) 52 + if templ_7745c5c3_Err != nil { 53 + return templ_7745c5c3_Err 54 + } 55 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</p></div></div>") 56 + if templ_7745c5c3_Err != nil { 57 + return templ_7745c5c3_Err 58 + } 59 + } 60 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<section class=\"border-t border-t-zinc-200 mt-6 px-2 py-4 w-96\"><p>Subscriptions</p><ul id=\"todo-list\">") 61 + if templ_7745c5c3_Err != nil { 62 + return templ_7745c5c3_Err 63 + } 64 + for _, sub := range subscriptions { 65 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<li class=\"ml-4 ml-4 border p-2 rounded-lg mb-2\" id=\"") 66 + if templ_7745c5c3_Err != nil { 67 + return templ_7745c5c3_Err 68 + } 69 + var templ_7745c5c3_Var3 string 70 + templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("sub%d", sub.ID)) 71 + if templ_7745c5c3_Err != nil { 72 + return templ.Error{Err: templ_7745c5c3_Err, FileName: `frontend/subscriptions.templ`, Line: 22, Col: 86} 73 + } 74 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) 75 + if templ_7745c5c3_Err != nil { 76 + return templ_7745c5c3_Err 77 + } 78 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><a class=\"font-medium text-sm\" href=\"") 79 + if templ_7745c5c3_Err != nil { 80 + return templ_7745c5c3_Err 81 + } 82 + var templ_7745c5c3_Var4 templ.SafeURL = templ.URL(sub.SubscribedPostURI) 83 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var4))) 84 + if templ_7745c5c3_Err != nil { 85 + return templ_7745c5c3_Err 86 + } 87 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\">") 88 + if templ_7745c5c3_Err != nil { 89 + return templ_7745c5c3_Err 90 + } 91 + var templ_7745c5c3_Var5 string 92 + templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(sub.SubscribedPostURI) 93 + if templ_7745c5c3_Err != nil { 94 + return templ.Error{Err: templ_7745c5c3_Err, FileName: `frontend/subscriptions.templ`, Line: 23, Col: 101} 95 + } 96 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) 97 + if templ_7745c5c3_Err != nil { 98 + return templ_7745c5c3_Err 99 + } 100 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</a><div class=\"flex gap-4 items-center mt-2\"><button hx-delete=\"") 101 + if templ_7745c5c3_Err != nil { 102 + return templ_7745c5c3_Err 103 + } 104 + var templ_7745c5c3_Var6 string 105 + templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("/sub/%d", sub.ID)) 106 + if templ_7745c5c3_Err != nil { 107 + return templ.Error{Err: templ_7745c5c3_Err, FileName: `frontend/subscriptions.templ`, Line: 26, Col: 49} 108 + } 109 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) 110 + if templ_7745c5c3_Err != nil { 111 + return templ_7745c5c3_Err 112 + } 113 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" hx-swap=\"delete\" hx-target=\"") 114 + if templ_7745c5c3_Err != nil { 115 + return templ_7745c5c3_Err 116 + } 117 + var templ_7745c5c3_Var7 string 118 + templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("#sub%d", sub.ID)) 119 + if templ_7745c5c3_Err != nil { 120 + return templ.Error{Err: templ_7745c5c3_Err, FileName: `frontend/subscriptions.templ`, Line: 28, Col: 48} 121 + } 122 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) 123 + if templ_7745c5c3_Err != nil { 124 + return templ_7745c5c3_Err 125 + } 126 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\" class=\"flex items-center border py-1 px-2 rounded-lg hover:bg-red-300\"><p class=\"text-sm\">Delete</p></button></div></li>") 127 + if templ_7745c5c3_Err != nil { 128 + return templ_7745c5c3_Err 129 + } 130 + } 131 + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</ul></section>") 132 + if templ_7745c5c3_Err != nil { 133 + return templ_7745c5c3_Err 134 + } 135 + return templ_7745c5c3_Err 136 + }) 137 + } 138 + 139 + var _ = templruntime.GeneratedTemplate