From 81c8242aef5120c9673d0e5cfd8e81d33b1a5372 Mon Sep 17 00:00:00 2001 From: Masahiro Kondou Date: Wed, 18 Aug 2021 23:14:32 +0900 Subject: [PATCH] Add author to page info (#8) --- cmd/graph.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/graph.go b/cmd/graph.go index 9c647c7..68e4596 100644 --- a/cmd/graph.go +++ b/cmd/graph.go @@ -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"` } @@ -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 {