1
0
mirror of https://github.com/minio/docs.git synced 2025-07-24 10:22:32 +03:00
Files
docs/source/_templates/layout.html
Rushan 376f37f69e Add search page (#687)
- Default Sphinx search page has been replaced with Algolia's 
- Enabled routing to sync the search results with URL

**Preview:**
<img width="1458" alt="Screenshot 2022-12-30 at 14 47 28"
src="https://user-images.githubusercontent.com/13393018/210061993-c906461e-87e2-426f-b956-462cfa77ed40.png">

**How to test:**
1. Click on a search result, navigate back using the browser back button
and check whether the search result modal is open and available.
2. Type a search keyword and press the enter key to navigate to the
search results page, where you can find all the results listed.

Note: You might need to start the local web server on the exact build
sub-directory to test the point number 2.
`build/[branch]/[platform]/html/` - ✔️
`build/` - 
2022-12-30 12:42:11 -06:00

96 lines
2.5 KiB
HTML

{# Import the theme's layout. #}
{% extends "!layout.html" %}
{# Custom CSS overrides #}
{% block extrahead %}
{%- include "head.html" %}
{{ super() }}
{% endblock %}
{# Override content block #}
{%- macro miniosidebar() %}
{%- if render_sidebar %}
<nav
class="docs"
role="navigation"
>
{%- block sidebarlogo %}
{%- if logo %}
<p class="logo">
<a href="{{ pathto(master_doc)|e }}">
<img
class="logo"
src="{{ pathto('_static/' + logo, 1)|e }}"
alt="Logo"
/>
</a>
</p>
{%- endif %}
{%- endblock %}
{%- if sidebars != None %}
{#- new style sidebar: explicitly include/exclude templates #}
{%- for sidebartemplate in sidebars %}
{%- include sidebartemplate %}
{%- endfor %}
{%- else %}
{#- old style sidebars: using blocks -- should be deprecated #}
{%- block sidebarrel %}
{%- include "relations.html" %}
{%- endblock %}
{%- block sidebarsourcelink %}
{%- include "sourcelink.html" %}
{%- endblock %}
{%- if customsidebar %}
{%- include customsidebar %}
{%- endif %}
{%- block sidebarsearch %}
{%- include "searchbox.html" %}
{%- endblock %}
{%- endif %}
</nav>
{%- endif %}
{%- endmacro %}
{%- block header %}
{%- include "header.html" %}
{%- endblock %}
{%- block content %}
<section class="content">
<div class="container">
<div class="sidebar inactive scrollbar">
<div class="hide-aside visible-rm">
<button type="button" class="icon">
{%- include "icons/close.html" %}
Close Doc Navigation
</button>
</div>
<a class="sidebar__title" href="{{ pathto('index') }}">{{ shorttitle}}</a>
{{ miniosidebar() }}
</div>
{%- include "toc.html" %}
<div class="content__main">
{% block body %} {% endblock %}
{%- if pagename != "search-results" %}
{%- include "footer.html" %}
{%- endif %}
</div>
</div>
</section>
{%- endblock %}
{%- block footer %}
{%- include "cookie.html" %}
{%- endblock %}