Skip to content

Commit

Permalink
DOC-3893 further ideas
Browse files Browse the repository at this point in the history
  • Loading branch information
andy-stark-redis committed Jun 21, 2024
1 parent e338474 commit 8a2328b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 8 deletions.
15 changes: 15 additions & 0 deletions data/nav.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@
{ "title": "Redis and RAG", "relref": "/develop/get-started/rag" },
{ "title": "FAQ", "relref": "/develop/get-started/faq" }
]
},
{
"title": "Connect", "relref": "/develop/connect", "children": [
{ "title": "CLI", "relref": "/develop/connect/cli"},
{ "title": "Redis Insight", "relref": "/develop/connect/insight"},
{
"title": "Client libraries", "relref": "/develop/connect/clients", "children": [
{ "title": "Python", "relref": "/develop/connect/clients/python"},
{ "title": "C#", "relref": "/develop/connect/clients/dotnet"},
{ "title": "Node.js", "relref": "/develop/connect/clients/nodejs"},
{ "title": "Java", "relref": "/develop/connect/clients/java"},
{ "title": "Go", "relref": "/develop/connect/clients/go"}
]
}
]
}
]
}
22 changes: 14 additions & 8 deletions layouts/partials/docs-nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,17 @@
{{ .Scratch.Set "path" $path}}
{{ end }}

{{ define navList -}}
{{ define "navList" -}}
{{ $item := .item }}
<ul class="child-list">
{{ range $item.children }}
<li class="my-2"><a href="{{ .relref }}">{{ .title }}</a>
{{- if .children }}
{{- template "navList" ( dict "item" . )}}
{{ end -}}
</li>
{{ end }}
</ul>
{{- end }}

<div class="md:block w-full md:w-96 h-fit md:h-full shrink-0 text-base font-mono font-normal py-6">
Expand All @@ -47,13 +57,9 @@
<div class='min-h-0 border border-opacity-50 border-redis-ink-900 rounded-md flex flex-col {{ if not (in (slice "Develop" "Integrate" "Operate") $navRoot.LinkTitle) }} shrink-0 {{ end }}'>
<a class='px-6 py-4 rounded-t-md hover:bg-redis-pen-200 {{ if eq $navRoot.LinkTitle "Develop" }} font-bold {{ end }}' href='{{ .Scratch.Get "path" }}/develop'>Develop with Redis</a>
{{ if eq $navRoot.LinkTitle "Develop" }}
<ul class="md:block overflow-y-auto grow pr-6 border-t border-opacity-50 border-redis-ink-900">
{{ range .Site.Data.nav.children }}
<li class="my-2"><a href="{{ .relref }}">{{ .title }}</a></li>
{{ end }}

{{ template "li" (dict "page" . "pages" (union $navRoot.Pages $navRoot.Sections).ByWeight) }}
</ul>
<ul class="md:block overflow-y-auto grow pr-6 border-t border-opacity-50 border-redis-ink-900">
{{- template "navList" ( dict "item" .Site.Data.nav )}}
</ul>
{{ end }}
<a class='px-6 py-4 hover:bg-redis-pen-200 border-t border-redis-ink-900 border-opacity-50 {{ if eq $navRoot.LinkTitle "Integrate" }} font-bold {{ end }}' href='{{ .Scratch.Get "path" }}/integrate'>Libraries and tools</a>
{{ if eq $navRoot.LinkTitle "Integrate" }}
Expand Down

0 comments on commit 8a2328b

Please sign in to comment.