sync: Also allow overview.md for themes
This commit is contained in:
parent
cf75367b5b
commit
dfe62e0b97
@ -129,7 +129,16 @@ func BuildTheme(i Importer, tdir string) (th *fic.Theme, errs []string) {
|
|||||||
th.Authors = strings.Join(authors, ", ")
|
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))
|
errs = append(errs, fmt.Sprintf("%q: unable to get theme's overview: %s", th.Name, err))
|
||||||
} else {
|
} else {
|
||||||
// Split headline from intro
|
// Split headline from intro
|
||||||
|
Loading…
Reference in New Issue
Block a user