1- {% extends "right -aside.html" %}
1+ {% extends "left -aside.html" %}
22
33{% import "macros/docs.html" as docs %}
44
2121
2222{% block subhead_content %}
2323{% if has_frontmatter and frontmatter_title %}
24- < h1 class ="page-title "> Documentation: {{ frontmatter_title }}</ h1 >
24+ < div class ="styled-title ">
25+ < h1 class ="page-title "> Documentation: {{ frontmatter_title }}</ h1 >
26+ </ div >
2527{% endif %}
2628{% endblock subhead_content %}
2729
30+ {% block breadcrumbs %}
31+ {# Breadcrumbs section #}
32+ < nav class ="breadcrumbs ">
33+ < ul class ="breadcrumb-list ">
34+ < li class ="breadcrumb-item ">
35+ < a href ="/topics/ " class ="breadcrumb-link "> Topics</ a >
36+ </ li >
37+ < li class ="breadcrumb-item breadcrumb-current " aria-current ="page ">
38+ < img src ="/img/caret-right.svg " alt ="Caret Right Icon " width ="8 " height ="10 "/>
39+ {% if frontmatter_title %}{{ frontmatter_title }}{% else %}{{ page.slug | upper }}{% endif %}
40+ </ li >
41+ </ ul >
42+ </ nav >
43+ {% endblock breadcrumbs %}
2844
2945{% block main_content %}
3046{% if config.extra.review_list is containing(page.path) %}
@@ -41,6 +57,56 @@ <h1 class="page-title">Documentation: {{ frontmatter_title }}</h1>
4157{% endblock main_content %}
4258
4359{% block related_content %}
60+ < div class ="sb-search-container ">
61+ < input type ="text " id ="sidebar-search-box " placeholder ="Search within topics " onkeyup ="searchSidebarTopics() " />
62+ </ div >
63+
64+ <!-- No results message for sidebar search -->
65+ < div id ="sidebar-no-results-message " class ="no-results-message " style ="display: none; ">
66+ < span > </></ span >
67+ < h4 > No topics found</ h4 >
68+ < p > Check your spelling or try different keywords</ p >
69+ </ div >
70+
71+ < h2 id ="topic-list-title "> Alphabetical Index</ h2 >
72+ < ul id ="topic-list "> </ ul >
73+
74+ < script >
75+ document . addEventListener ( "DOMContentLoaded" , function ( ) {
76+ var
77+ topicListEl = document . getElementById ( 'topic-list' ) ,
78+ f = fetch ( "/topics-list/" ) ;
79+
80+ f . then ( ( r ) => r . text ( ) ) . then ( ( v ) => { topicListEl . innerHTML = v ; } )
81+ f . catch ( ( error ) => { topicListEl . innerHTML = "Could not load topic list." ; } ) ;
82+ } ) ;
83+
84+ function searchSidebarTopics ( ) {
85+ var input = document . getElementById ( "sidebar-search-box" ) . value . toLowerCase ( ) ;
86+ var topicList = document . getElementById ( "topic-list" ) ;
87+ var topicListTitle = document . getElementById ( "topic-list-title" ) ;
88+ var items = topicList . querySelectorAll ( ".topic-list-item" ) ;
89+ var noResultsMessage = document . getElementById ( "sidebar-no-results-message" ) ;
90+ var totalVisible = 0 ;
91+
92+ items . forEach ( function ( item ) {
93+ var text = item . querySelector ( "a" ) . innerText . toLowerCase ( ) ;
94+ if ( text . includes ( input ) ) {
95+ item . style . display = "" ;
96+ totalVisible ++ ;
97+ } else {
98+ item . style . display = "none" ;
99+ }
100+ } ) ;
101+
102+ // Show/hide no results message and title based on search results
103+ var hasResults = totalVisible > 0 ;
104+ noResultsMessage . style . display = hasResults ? "none" : "block" ;
105+ topicListTitle . style . display = hasResults ? "" : "none" ;
106+ topicList . style . display = hasResults ? "" : "none" ;
107+ }
108+ </ script >
109+
44110< div class ="edit_box ">
45111 See an error?
46112 < a href ="https://github.com/valkey-io/valkey-doc/edit/main/topics/{{ page.slug }}.md "> Update this Page on GitHub!</ a >
0 commit comments