diff --git a/internal/puzzles/solutions/new.go b/internal/puzzles/solutions/new.go index 84ffeb2c..8a927293 100644 --- a/internal/puzzles/solutions/new.go +++ b/internal/puzzles/solutions/new.go @@ -12,7 +12,7 @@ import ( func createNewFromTemplate(purl string) error { const ( - perms = 0o655 + perms = os.ModePerm yearLen = 4 dayLen = 2 ) @@ -38,10 +38,13 @@ func createNewFromTemplate(purl string) error { } params := templates.Params{ - Year: year, - Day: pd.day, - DayStr: day, - URL: purl, + Year: year, + Day: pd.day, + DayStr: day, + URL: purl, + Title: "", + DescriptionPartOne: "", + DescriptionPartTwo: "", } path := filepath.Clean(filepath.Join(year, "day"+day)) diff --git a/internal/puzzles/solutions/templates/embed.go b/internal/puzzles/solutions/templates/embed.go index 3757431a..41f7571a 100644 --- a/internal/puzzles/solutions/templates/embed.go +++ b/internal/puzzles/solutions/templates/embed.go @@ -19,10 +19,13 @@ var ( // Params contains parameters for templates. type Params struct { - Year string // e.g. "2023" - Day int // e.g. 2 - DayStr string // e.g. "02" - URL string // e.g. "https://adventofcode.com/2023/day/2" + Year string // e.g. "2023" + Day int // e.g. 2 + DayStr string // e.g. "02" + URL string // e.g. "https://adventofcode.com/2023/day/2" + Title string // For now it's empty. + DescriptionPartOne string // For now it's empty. + DescriptionPartTwo string // For now it's empty. } // SolutionTmpl returns template for solution.go file. diff --git a/internal/puzzles/solutions/templates/spec.md.tmpl b/internal/puzzles/solutions/templates/spec.md.tmpl index 139597f9..9724dbe5 100644 --- a/internal/puzzles/solutions/templates/spec.md.tmpl +++ b/internal/puzzles/solutions/templates/spec.md.tmpl @@ -1,2 +1,12 @@ +# Puzzle {{ .URL }} +# --- Day {{ .Day }}: {{ .Title }} --- + +## --- Part One --- + +{{ .DescriptionPartOne }} + +## --- Part Two --- + +{{ .DescriptionPartTwo }}