From 8c8c5c7aefe6205a1110dad7789c65456370bd7a Mon Sep 17 00:00:00 2001 From: mirkobrombin Date: Thu, 11 Jul 2024 13:26:21 +0200 Subject: [PATCH] feat: Add startSlug field to Story struct --- articles/stories.yml | 3 ++- core/loader.go | 1 + structs/story.go | 7 ++++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/articles/stories.yml b/articles/stories.yml index f2a86c1..833041e 100644 --- a/articles/stories.yml +++ b/articles/stories.yml @@ -1,3 +1,4 @@ - id: testing name: My First Story - description: See how cool is my first story \ No newline at end of file + description: See how cool is my first story + startSlug: test \ No newline at end of file diff --git a/core/loader.go b/core/loader.go index 7f86fd9..eb349b9 100644 --- a/core/loader.go +++ b/core/loader.go @@ -406,6 +406,7 @@ func loadStories(repo *structs.Repo) (map[string]structs.Story, error) { storiesMap := make(map[string]structs.Story) for _, story := range stories { storiesMap[story.Id] = story + fmt.Printf("(loader): Loaded story: %s\n", story.Name) } return storiesMap, nil diff --git a/structs/story.go b/structs/story.go index 8e2d355..836b25d 100644 --- a/structs/story.go +++ b/structs/story.go @@ -2,7 +2,8 @@ package structs // Story is the struct that represents a story, a sequence of articles. type Story struct { - Id string - Name string - Description string + Id string `yaml:"id"` + Name string `yaml:"name"` + Description string `yaml:"description"` + StartSlug string `yaml:"startSlug"` }