Skip to content

Commit

Permalink
fix: back to the top link when no repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Jun 24, 2024
1 parent 45255b7 commit 5f0a5d0
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions scripts/website/expand_templates/linters.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ func getLintersListMarkdown(enabled bool) string {
}

func getName(lc *types.LinterWrapper) string {
name := lc.Name
name := spanWithID(listItemPrefix+lc.Name, "", "")

if hasSettings(lc.Name) {
name = fmt.Sprintf("[%[1]s](#%[2]s \"%[1]s configuration\")", name, lc.Name)
name += fmt.Sprintf("[%[1]s](#%[1]s \"%[1]s configuration\")", lc.Name)
} else {
name = fmt.Sprintf("%s [%s](#%s)", spanWithID(lc.Name, "", ""), name, lc.Name)
name += fmt.Sprintf("%[1]s[%[2]s](#%[2]s)", spanWithID(lc.Name, "", ""), lc.Name)
}

if lc.OriginalURL != "" {
Expand All @@ -104,9 +104,7 @@ func getName(lc *types.LinterWrapper) string {
icon = "<FaGitlab size={'0.8rem'} />"
}

name = fmt.Sprintf("%s%s&nbsp;[%s](%s)",
spanWithID(listItemPrefix+lc.Name, "", ""),
name,
name += fmt.Sprintf("&nbsp;[%s](%s)",
span(lc.Name+" repository", icon),
lc.OriginalURL,
)
Expand Down

0 comments on commit 5f0a5d0

Please sign in to comment.