all repos — honk @ 6fa575fb2161d4c776f12d7df5704806e1269428

my fork of honk

jump links for tags
Ted Unangst tedu@tedunangst.com
Sat, 02 Mar 2024 20:20:14 -0500
commit

6fa575fb2161d4c776f12d7df5704806e1269428

parent

5d8298cf3ac70bf4a47e7be4882c5c997dad25d8

2 files changed, 11 insertions(+), 1 deletions(-)

jump to
M views/onts.htmlviews/onts.html

@@ -2,6 +2,7 @@ {{ template "header.html" . }}

<main> <div class="info"> <p>ontologies of interest +<p>{{ range .Letters }}<a href="#{{.}}">{{.}}</a> {{ end }} {{ $firstrune := .FirstRune }} <ul> <li><p>

@@ -12,7 +13,7 @@ {{ $letter := 0 }}

{{ range .Onts }} {{ if not (eq $letter (call $firstrune .Name)) }} {{ $letter = (call $firstrune .Name) }} -<li><p> +<li><p><a name="{{ printf "%c" $letter}}"></a> {{ end }} <span class="wsnowrap"><a href="/o/{{ .Name }}">#{{ .Name }}</a> ({{ .Count }})</span> {{ end }}
M web.goweb.go

@@ -989,12 +989,21 @@ })

if len(pops) > 40 { pops = pops[:40] } + var letters []string + var lastrune rune = -1 + for _, o := range onts { + if r := firstRune(o.Name); r != lastrune { + letters = append(letters, string(r)) + lastrune = r + } + } if u == nil && !develMode { w.Header().Set("Cache-Control", "max-age=300") } templinfo := getInfo(r) templinfo["Pops"] = pops templinfo["Onts"] = onts + templinfo["Letters"] = letters templinfo["FirstRune"] = firstRune err = readviews.Execute(w, "onts.html", templinfo) if err != nil {