Skip to content

Commit

Permalink
ci(examples): demo is now always at the top (#607)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarvinJWendt committed Jan 3, 2024
1 parent ddd40f5 commit 8f836c8
Showing 1 changed file with 9 additions and 2 deletions.
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

0 comments on commit 8f836c8

Please sign in to comment.