From e846bc1d7d9424d14dea1621b89c10e57f5bb42a Mon Sep 17 00:00:00 2001 From: Feuerfuchs Date: Mon, 18 May 2020 20:35:31 +0200 Subject: Fix nav for both Gopher and Gemini --- internal/port/gemini.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'internal/port/gemini.go') diff --git a/internal/port/gemini.go b/internal/port/gemini.go index 2695214..f574816 100644 --- a/internal/port/gemini.go +++ b/internal/port/gemini.go @@ -49,21 +49,18 @@ func urlToGeminiNav(url string) (items []GeminiNavItem) { parts = parts[:len(parts)-1] } - for i, part := range parts { + for _, part := range parts { partialURL = partialURL + "/" + part - current := false - if i == len(parts)-1 { - current = true - } - items = append(items, GeminiNavItem{ Label: part, URL: partialURL, - Current: current, + Current: false, }) } + items[len(items)-1].Current = true + return } -- cgit v1.2.3-70-g09d2