From f7f892fb59f8e728ce8f67eec0094b839ecf8079 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch Date: Sat, 15 Aug 2020 07:19:53 +0200 Subject: hswg: deduplicate backlinks --- hswg/main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'hswg') diff --git a/hswg/main.go b/hswg/main.go index 2a46c6e..dfc6ed3 100644 --- a/hswg/main.go +++ b/hswg/main.go @@ -236,9 +236,12 @@ func main() { sort.Strings(e.backlinks) - backlinks := []string{} + backlinks, last := []string{}, "" for _, name := range e.backlinks { - backlinks = append(backlinks, makeLink(&entries, name)) + if name != last { + backlinks = append(backlinks, makeLink(&entries, name)) + } + last = name } if len(backlinks) > 0 { -- cgit v1.2.3-70-g09d2