Skip to content

Commit

Permalink
feat(chie): append normalized normalized additional name to title tag…
Browse files Browse the repository at this point in the history
… index
  • Loading branch information
momo-p committed Oct 30, 2024
1 parent 5b45642 commit 786b250
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions services/chie/titles.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ func updateTitleIndexTags(index *titleIndex) error {
normalizeTitleName(index.Name),
}
index.Tags = append(index.Tags, index.AdditionalName...)
index.Tags = append(index.Tags, normalizeAdditionalName(index.AdditionalName)...)
return nil
}

Expand All @@ -339,3 +340,18 @@ func normalizeTitleName(name string) string {
" ",
)
}

func normalizeAdditionalName(additionalName []string) []string {
normalizedAdditionalName := []string{}
for _, name := range additionalName {
normalizedAdditionalName = append(
normalizedAdditionalName,
strings.ReplaceAll(
slug.Make(name),
"-",
" ",
),
)
}
return normalizedAdditionalName
}

0 comments on commit 786b250

Please sign in to comment.