aboutsummaryrefslogtreecommitdiff
path: root/hswg/main.go
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2020-08-15 07:19:53 +0200
committerPřemysl Eric Janouch <p@janouch.name>2020-08-15 07:20:04 +0200
commitf7f892fb59f8e728ce8f67eec0094b839ecf8079 (patch)
tree23bfaf5318a597ba521d958cd45d212d7233ec12 /hswg/main.go
parentd0ce3e3e661852880fd2313ae3f9523ee6333253 (diff)
downloadhaven-f7f892fb59f8e728ce8f67eec0094b839ecf8079.tar.gz
haven-f7f892fb59f8e728ce8f67eec0094b839ecf8079.tar.xz
haven-f7f892fb59f8e728ce8f67eec0094b839ecf8079.zip
hswg: deduplicate backlinks
Diffstat (limited to 'hswg/main.go')
-rw-r--r--hswg/main.go7
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 {