Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(examples): demo is now always at the top #607

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 9 additions & 2 deletions ci/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,15 @@ func generateSectionContent(section os.DirEntry) string {
return true
})

sort.Strings(keys)
sort.Slice(keys, func(i, j int) bool {
if keys[i] == "demo" {
return true
}
if keys[j] == "demo" {
return false
}
return keys[i] < keys[j]
})

for _, key := range keys {
value, _ := exampleMap.Load(key)
Expand All @@ -296,7 +304,6 @@ func generateSectionContent(section os.DirEntry) string {

return sectionExamples
}

func generateExampleContent(dir string, section os.DirEntry, example os.DirEntry) string {
var content string

Expand Down