Skip to content

Commit

Permalink
feat: Add startSlug field to Story struct
Browse files Browse the repository at this point in the history
  • Loading branch information
mirkobrombin committed Jul 11, 2024
1 parent be6dd23 commit 8c8c5c7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion articles/stories.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- id: testing
name: My First Story
description: See how cool is my first story
description: See how cool is my first story
startSlug: test
1 change: 1 addition & 0 deletions core/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions structs/story.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}

0 comments on commit 8c8c5c7

Please sign in to comment.