admin: Handle more info in challenge.json

This commit is contained in:
nemunaire 2022-05-31 18:18:08 +02:00
parent 4c84038b28
commit f65375b01f
2 changed files with 61 additions and 5 deletions

View file

@ -9,25 +9,38 @@ import (
// ChallengeFile is the expected name of the file containing the challenge infos.
const ChallengeFile = "challenge.json"
type ChallengePartner struct {
Src string `json:"img"`
Alt string `json:"alt,omitempty"`
Href string `json:"href,omitempty"`
}
// ChallengeInfo stores common descriptions and informations about the challenge.
type ChallengeInfo struct {
// Title is the displayed name of the challenge.
Title string `json:"title"`
// SubTitle is appended to the title.
SubTitle string `json:"subtitle"`
SubTitle string `json:"subtitle,omitempty"`
// Authors is the group name of people making the challenge.
Authors string `json:"authors"`
// ExpectedDuration is the duration (in minutes) suggested when stating the challenge.
ExpectedDuration uint `json:"duration"`
// VideoLink is the link to explaination videos when the challenge is over.
VideosLink string `json:"videoslink"`
VideosLink string `json:"videoslink,omitempty"`
// Description gives an overview of the challenge.
Description string `json:"description"`
Description string `json:"description,omitempty"`
// Rules tell the player some help.
Rules string `json:"rules"`
Rules string `json:"rules,omitempty"`
// YourMission is a small introduction to understand the goals.
YourMission string `json:"your_mission"`
YourMission string `json:"your_mission,omitempty"`
// MainLogo stores path to logos displayed in the header.
MainLogo []string `json:"main_logo,omitempty"`
// MainLink stores link to the parent website.
MainLink string `json:"main_link,omitempty"`
// Partners holds the challenge partners list.
Partners []ChallengePartner `json:"partners,omitempty"`
}
// ReadChallenge parses the file at the given location.