sync: Also allow overview.md for themes

This commit is contained in:
nemunaire 2022-06-11 12:00:36 +02:00
parent cf75367b5b
commit dfe62e0b97
1 changed files with 10 additions and 1 deletions

View File

@ -129,7 +129,16 @@ func BuildTheme(i Importer, tdir string) (th *fic.Theme, errs []string) {
th.Authors = strings.Join(authors, ", ")
}
if intro, err := GetFileContent(i, path.Join(tdir, "overview.txt")); err != nil {
var intro string
var err error
if i.exists(path.Join(tdir, "overview.txt")) {
intro, err = GetFileContent(i, path.Join(tdir, "overview.txt"))
} else if i.exists(path.Join(tdir, "overview.md")) {
intro, err = GetFileContent(i, path.Join(tdir, "overview.md"))
} else {
err = fmt.Errorf("unable to find overview.txt nor overview.md")
}
if err != nil {
errs = append(errs, fmt.Sprintf("%q: unable to get theme's overview: %s", th.Name, err))
} else {
// Split headline from intro