diff --git a/flake.lock b/flake.lock index f271bd8543f1892bea05b8dfa9992156d67e6a9f..136d8d5a1275fbc1710f15609e3c352e3525d165 100644 --- a/flake.lock +++ b/flake.lock @@ -30,11 +30,11 @@ "nixpkgs" ] }, "locked": { - "lastModified": 1753803577, - "narHash": "sha256-sE5IgsHacXmfsWJjVVPvb7Aa6oHElt+nfP6+3Pqa414=", + "lastModified": 1695841587, + "narHash": "sha256-fgiZd5AV+hi8Ne0bJ8SyAx5nppseW4aXJQEIDSr0VNA=", "ref": "refs/heads/main", - "rev": "4ce9431cbb4e9e5dceadfbc413fbd34e7305fe8e", - "revCount": 3, + "rev": "afca060674b20e0ccecde2d6fe88c887790219a5", + "revCount": 1, "type": "git", "url": "https://git.jolheiser.com/tailwind-ctp" }, diff --git a/go.mod.sri b/go.mod.sri index fcc8e850151439b426734cc52fe67f471cc13a15..9c722ac99721ff649eab2a2a3b972419d4448c4a 100644 --- a/go.mod.sri +++ b/go.mod.sri @@ -1 +1 @@ -sha256-SkG1ZQRtfpCtxD7a+Qrmrg5r6FSOMaJy8htPSVXTCcM= \ No newline at end of file +sha256-DjweXB8uqEpOIBwGabLCnVL4ZOKkPcJDf6JlAS5FmKI= \ No newline at end of file diff --git a/internal/html/generate.go b/internal/html/generate.go index 200d9136c62762ffaec7f50d0a766e321986471a..843f333f9559ca22bdc478e8e25d80a3fca72619 100644 --- a/internal/html/generate.go +++ b/internal/html/generate.go @@ -73,7 +73,7 @@ } defer styles.Close() var buf bytes.Buffer - cmd := exec.Command("tailwind-ctp_3", "-i", tmp.Name(), "--minify") + cmd := exec.Command("tailwind-ctp", "-i", tmp.Name(), "--minify") cmd.Stdout = &buf if err := cmd.Run(); err != nil { return err diff --git a/internal/html/repo_tree.templ b/internal/html/repo_tree.templ index 2e2e154ee018a234c35e633f875c692283fe8ae2..170c534e357a588d8bebf03e8d36b221622fa846 100644 --- a/internal/html/repo_tree.templ +++ b/internal/html/repo_tree.templ @@ -11,6 +11,7 @@ RepoHeaderComponentContext RepoBreadcrumbComponentContext RepoTreeComponentContext ReadmeComponentContext + Description string } templ RepoTree(rtc RepoTreeContext) { diff --git a/internal/html/repo_tree_templ.go b/internal/html/repo_tree_templ.go index 321e0a55fabffbc2f334bfb2a16de40b00c42e56..a0320516f424a88ecdbed9ddaff1f611cef11de1 100644 --- a/internal/html/repo_tree_templ.go +++ b/internal/html/repo_tree_templ.go @@ -19,6 +19,7 @@ RepoHeaderComponentContext RepoBreadcrumbComponentContext RepoTreeComponentContext ReadmeComponentContext + Description string } func RepoTree(rtc RepoTreeContext) templ.Component { @@ -139,7 +140,7 @@ } var templ_7745c5c3_Var4 templ.SafeURL templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(fmt.Sprintf("/%s/tree/%s/%s", rtcc.Repo, rtcc.Ref, rtcc.Back))) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_tree.templ`, Line: 43, Col: 194} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_tree.templ`, Line: 44, Col: 194} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { @@ -158,7 +159,7 @@ } var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(fi.Mode) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_tree.templ`, Line: 46, Col: 50} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_tree.templ`, Line: 47, Col: 50} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { @@ -171,7 +172,7 @@ } var templ_7745c5c3_Var6 string templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(fi.Size) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_tree.templ`, Line: 47, Col: 50} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_tree.templ`, Line: 48, Col: 50} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) if templ_7745c5c3_Err != nil { @@ -184,7 +185,7 @@ } var templ_7745c5c3_Var7 templ.SafeURL templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(fmt.Sprintf("/%s/tree/%s/%s", rtcc.Repo, rtcc.Ref, fi.Path))) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_tree.templ`, Line: 48, Col: 222} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_tree.templ`, Line: 49, Col: 222} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) if templ_7745c5c3_Err != nil { @@ -197,7 +198,7 @@ } var templ_7745c5c3_Var8 string templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(slashDir(fi.Name(), fi.IsDir)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_tree.templ`, Line: 48, Col: 256} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `repo_tree.templ`, Line: 49, Col: 256} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) if templ_7745c5c3_Err != nil { diff --git a/internal/http/http.go b/internal/http/http.go index 844652d081156b4bb835e3cffdfbe0f6c8fcceea..b89b8242cf37a25d0bc34562822ffe750a7d53c2 100644 --- a/internal/http/http.go +++ b/internal/http/http.go @@ -116,13 +116,6 @@ Description: rh.s.Description, } } -func (rh repoHandler) repoBaseContext(repo *git.Repo) html.BaseContext { - return html.BaseContext{ - Title: repo.Name(), - Description: repo.Meta.Description, - } -} - func (rh repoHandler) repoHeaderContext(repo *git.Repo, r *http.Request) html.RepoHeaderComponentContext { ref := chi.URLParam(r, "ref") if ref == "" { diff --git a/internal/http/repo.go b/internal/http/repo.go index d59cb59bd0cb984bc1647f1c06df69f32776215d..fec56d2eb3412e1609ca4b86dff941ae43f2acd6 100644 --- a/internal/http/repo.go +++ b/internal/http/repo.go @@ -48,7 +48,8 @@ if path != "" { back = filepath.Dir(path) } if err := html.RepoTree(html.RepoTreeContext{ - BaseContext: rh.repoBaseContext(repo), + Description: repo.Meta.Description, + BaseContext: rh.baseContext(), RepoHeaderComponentContext: rh.repoHeaderContext(repo, r), RepoBreadcrumbComponentContext: rh.repoBreadcrumbContext(repo, r, path), RepoTreeComponentContext: html.RepoTreeComponentContext{ @@ -100,7 +101,7 @@ } } if err := html.RepoFile(html.RepoFileContext{ - BaseContext: rh.repoBaseContext(repo), + BaseContext: rh.baseContext(), RepoHeaderComponentContext: rh.repoHeaderContext(repo, r), RepoBreadcrumbComponentContext: rh.repoBreadcrumbContext(repo, r, path), Code: buf.String(), @@ -127,7 +128,7 @@ return httperr.Error(err) } if err := html.RepoRefs(html.RepoRefsContext{ - BaseContext: rh.repoBaseContext(repo), + BaseContext: rh.baseContext(), RepoHeaderComponentContext: rh.repoHeaderContext(repo, r), Branches: branches, Tags: tags, @@ -147,7 +148,7 @@ return httperr.Error(err) } if err := html.RepoLog(html.RepoLogContext{ - BaseContext: rh.repoBaseContext(repo), + BaseContext: rh.baseContext(), RepoHeaderComponentContext: rh.repoHeaderContext(repo, r), Commits: commits, }).Render(r.Context(), w); err != nil { @@ -174,7 +175,7 @@ commit.Files[idx].Patch = patch.String() } if err := html.RepoCommit(html.RepoCommitContext{ - BaseContext: rh.repoBaseContext(repo), + BaseContext: rh.baseContext(), RepoHeaderComponentContext: rh.repoHeaderContext(repo, r), Commit: commit, }).Render(r.Context(), w); err != nil { @@ -218,7 +219,7 @@ } } if err := html.RepoSearch(html.SearchContext{ - BaseContext: rh.repoBaseContext(repo), + BaseContext: rh.baseContext(), RepoHeaderComponentContext: rh.repoHeaderContext(repo, r), Results: results, }).Render(r.Context(), w); err != nil {