aboutsummaryrefslogtreecommitdiffstats
path: root/internal/port/gemini.go
diff options
context:
space:
mode:
authorFeuerfuchs <git@feuerfuchs.dev>2020-05-18 20:35:31 +0200
committerFeuerfuchs <git@feuerfuchs.dev>2020-05-18 20:35:31 +0200
commite846bc1d7d9424d14dea1621b89c10e57f5bb42a (patch)
treec1f1d8ca3b066ab00b1171cf4b9f28fb3a23e272 /internal/port/gemini.go
parentFix nav error for Gemini (diff)
downloadgopherproxy-e846bc1d7d9424d14dea1621b89c10e57f5bb42a.tar.gz
gopherproxy-e846bc1d7d9424d14dea1621b89c10e57f5bb42a.tar.bz2
gopherproxy-e846bc1d7d9424d14dea1621b89c10e57f5bb42a.zip
Fix nav for both Gopher and Gemini
Diffstat (limited to 'internal/port/gemini.go')
-rw-r--r--internal/port/gemini.go11
1 files changed, 4 insertions, 7 deletions
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) {
49 parts = parts[:len(parts)-1] 49 parts = parts[:len(parts)-1]
50 } 50 }
51 51
52 for i, part := range parts { 52 for _, part := range parts {
53 partialURL = partialURL + "/" + part 53 partialURL = partialURL + "/" + part
54 54
55 current := false
56 if i == len(parts)-1 {
57 current = true
58 }
59
60 items = append(items, GeminiNavItem{ 55 items = append(items, GeminiNavItem{
61 Label: part, 56 Label: part,
62 URL: partialURL, 57 URL: partialURL,
63 Current: current, 58 Current: false,
64 }) 59 })
65 } 60 }
66 61
62 items[len(items)-1].Current = true
63
67 return 64 return
68} 65}
69 66