frontend: beautiful URLs

This commit is contained in:
nemunaire 2018-01-18 11:07:50 +01:00 committed by nemunaire
parent bd75157a79
commit 0c540a39eb
13 changed files with 54 additions and 31 deletions

View file

@ -50,7 +50,7 @@ func SyncThemes(i Importer) []string {
} else if intro, err = getFileContent(i, path.Join(tname, "introduction.txt")); err != nil {
errs = append(errs, fmt.Sprintf("%q: unable to get introduction: %s", tname, err))
} else if theme, err = fic.GetThemeByName(tname); err != nil {
if _, err := fic.CreateTheme(tname, strings.Join(authors, ", "), intro); err != nil {
if _, err := fic.CreateTheme(tname, fic.ToURLid(tname), strings.Join(authors, ", "), intro); err != nil {
errs = append(errs, fmt.Sprintf("%q: an error occurs during add: %s", tname, err))
continue
}