fic: Can overwrite authors for each exercice

This commit is contained in:
nemunaire 2023-06-14 21:04:56 +02:00
commit 28ad0fa791
5 changed files with 23 additions and 11 deletions

View file

@ -139,6 +139,15 @@ func BuildExercice(i Importer, theme *fic.Theme, epath string, dmap *map[int64]*
e.URLId = fic.ToURLid(e.Title)
e.Title = fixnbsp(e.Title)
if i.Exists(path.Join(epath, "AUTHORS.txt")) {
if authors, err := getAuthors(i, epath); err != nil {
errs = append(errs, NewExerciceError(e, fmt.Errorf("unable to get AUTHORS.txt: %w", err)))
} else {
// Format authors
e.Authors = strings.Join(authors, ", ")
}
}
// Texts to format using Markdown
if i.Exists(path.Join(epath, "overview.txt")) {
e.Overview, err = GetFileContent(i, path.Join(epath, "overview.txt"))