sync: import texts as Markdown

This commit is contained in:
nemunaire 2018-08-17 21:18:10 +02:00 committed by Pierre-Olivier Mercier
parent be7a159815
commit c33390fa80
4 changed files with 16 additions and 6 deletions

View file

@ -7,6 +7,7 @@ import (
"srs.epita.fr/fic-server/libfic"
"github.com/julienschmidt/httprouter"
"gopkg.in/russross/blackfriday.v2"
)
// getThemes returns all theme directories in the base directory.
@ -67,8 +68,12 @@ func SyncThemes(i Importer) []string {
}
}
// Format authors
authors_str := strings.Join(authors, ", ")
// Format overview (markdown)
intro = string(blackfriday.Run([]byte(intro)))
if theme.Name != tname || theme.Authors != authors_str || theme.Intro != intro {
theme.Name = tname
theme.Authors = authors_str