diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2020-08-15 07:19:53 +0200 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2020-08-15 07:20:04 +0200 |
commit | f7f892fb59f8e728ce8f67eec0094b839ecf8079 (patch) | |
tree | 23bfaf5318a597ba521d958cd45d212d7233ec12 /hswg | |
parent | d0ce3e3e661852880fd2313ae3f9523ee6333253 (diff) | |
download | haven-f7f892fb59f8e728ce8f67eec0094b839ecf8079.tar.gz haven-f7f892fb59f8e728ce8f67eec0094b839ecf8079.tar.xz haven-f7f892fb59f8e728ce8f67eec0094b839ecf8079.zip |
hswg: deduplicate backlinks
Diffstat (limited to 'hswg')
-rw-r--r-- | hswg/main.go | 7 |
1 files changed, 5 insertions, 2 deletions
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 { |