fix: add cases.NoLower option for we can get same effect to strings.Title

Signed-off-by: wujunwei <wjw3323@live.com>
pull/11274/head
wujunwei 2 years ago
parent d7b4c38c42
commit f0037e5ef6

@ -86,7 +86,7 @@ func (o *docsOptions) run(out io.Writer) error {
hdrFunc := func(filename string) string {
base := filepath.Base(filename)
name := strings.TrimSuffix(base, path.Ext(base))
title := cases.Title(language.Und).String(strings.Replace(name, "_", " ", -1))
title := cases.Title(language.Und, cases.NoLower).String(strings.Replace(name, "_", " ", -1))
return fmt.Sprintf("---\ntitle: \"%s\"\n---\n\n", title)
}

Loading…
Cancel
Save