Skip to content

Commit

Permalink
readme endpoint also shows chart branch by default
Browse files Browse the repository at this point in the history
  • Loading branch information
kevincobain2000 committed Jan 23, 2024
1 parent 0a121c2 commit 9dde3f4
Showing 1 changed file with 15 additions and 22 deletions.
37 changes: 15 additions & 22 deletions app/pkg/readme.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,15 @@ func (r *Readme) Get(req *ReadmeRequest, types []models.Type) (string, error) {
PlainText("")
mdText.H3("Branch").
PlainText("")
if req.Branch != "" {

mdText.H4("Single").
PlainText("")
mdText.H4("Single").
PlainText("")

for _, t := range types {
u := fmt.Sprintf("%s://%s%schart?org=%s&repo=%s&type=%s&branch=%s",
req.scheme, req.host, os.Getenv("BASE_URL"), req.Org, req.Repo, t.Name, req.Branch)
mdText.PlainTextf(md.Image(t.Name, u))
}
mdText.PlainText("")
for _, t := range types {
u := fmt.Sprintf("%s://%s%schart?org=%s&repo=%s&type=%s&branch=%s",
req.scheme, req.host, os.Getenv("BASE_URL"), req.Org, req.Repo, t.Name, req.Branch)
mdText.PlainTextf(md.Image(t.Name, u))
}
mdText.PlainText("")

mdText.H4("All").PlainText("")
for _, t := range types {
Expand All @@ -65,21 +62,17 @@ func (r *Readme) Get(req *ReadmeRequest, types []models.Type) (string, error) {

mdText.H3("User").PlainText("")

if req.User != "" {
mdText.H3("User").
PlainText("")
mdText.H4("Single").
PlainText("")

for _, t := range types {
u := fmt.Sprintf("%s://%s%schart?org=%s&repo=%s&type=%s&user=%s",
req.scheme, req.host, os.Getenv("BASE_URL"), req.Org, req.Repo, t.Name, req.User)
mdText.PlainTextf(md.Image(t.Name, u))
}
mdText.H4("Single").
PlainText("")

mdText.PlainText("")
for _, t := range types {
u := fmt.Sprintf("%s://%s%schart?org=%s&repo=%s&type=%s&user=%s",
req.scheme, req.host, os.Getenv("BASE_URL"), req.Org, req.Repo, t.Name, req.User)
mdText.PlainTextf(md.Image(t.Name, u))
}

mdText.PlainText("")

mdText.H3("All").
PlainText("")
for _, t := range types {
Expand Down

0 comments on commit 9dde3f4

Please sign in to comment.