Skip to content

Commit

Permalink
Add author to page info (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
kondoumh authored Aug 18, 2021
1 parent 913ee49 commit 81c8242
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
type page struct {
ID string `json:"id"`
Title string `json:"title"`
Author string `json:"author"`
Views int `json:"views"`
Linked int `json:"linked"`
}
Expand Down Expand Up @@ -112,7 +113,7 @@ func buildGraph(cmd *cobra.Command) {
for _, p := range pages {
gid := graph.AddNode(p.Title)
pNodes[p.ID] = gid
pGraph.Pages = append(pGraph.Pages, page{p.ID, p.Title, p.Views, p.Linked})
pGraph.Pages = append(pGraph.Pages, page{p.ID, p.Title, p.Author.ID, p.Views, p.Linked})
}
uNodes := map[string]int{}
if includeUser {
Expand Down

0 comments on commit 81c8242

Please sign in to comment.