fic: Can overwrite authors for each exercice
This commit is contained in:
parent
1a8ebcb8bf
commit
28ad0fa791
5 changed files with 23 additions and 11 deletions
|
|
@ -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"))
|
||||
|
|
|
|||
Reference in a new issue