Skip to content

Commit 5dda905

Browse files
committed
[docs]: Update layout to match updated deps
Changes to GH Pages forced us to update the gh-pages gem, which in turn updated the just-the-docs theme from 0.3.3 to 0.10. This required changing the default layout we had. Fortunately the new layout worked out of the box, and I just needed to port over a small change: Adding H1 headers to pages. We also added a bright PREVIEW banner to every page, but I dropped it. After all these years, I think we can graduate these docs to FINAL :)
1 parent 3e21caf commit 5dda905

1 file changed

Lines changed: 30 additions & 188 deletions

File tree

_layouts/default.html

100644100755
Lines changed: 30 additions & 188 deletions
Original file line numberDiff line numberDiff line change
@@ -7,200 +7,42 @@
77
<html lang="{{ site.lang | default: 'en-US' }}">
88
{% include head.html %}
99
<body>
10-
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
11-
<symbol id="svg-link" viewBox="0 0 24 24">
12-
<title>Link</title>
13-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-link">
14-
<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path>
15-
</svg>
16-
</symbol>
17-
<symbol id="svg-search" viewBox="0 0 24 24">
18-
<title>Search</title>
19-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search">
20-
<circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line>
21-
</svg>
22-
</symbol>
23-
<symbol id="svg-menu" viewBox="0 0 24 24">
24-
<title>Menu</title>
25-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-menu">
26-
<line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line>
27-
</svg>
28-
</symbol>
29-
<symbol id="svg-arrow-right" viewBox="0 0 24 24">
30-
<title>Expand</title>
31-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-right">
32-
<polyline points="9 18 15 12 9 6"></polyline>
33-
</svg>
34-
</symbol>
35-
<symbol id="svg-doc" viewBox="0 0 24 24">
36-
<title>Document</title>
37-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-file">
38-
<path d="M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"></path><polyline points="13 2 13 9 20 9"></polyline>
39-
</svg>
40-
</symbol>
41-
</svg>
42-
43-
<div class="side-bar">
44-
45-
<div style="background-color: orange;text-align: center; width: 100%; padding: 10px; font-size: 24px;"><b>&#9888; PREVIEW &#9888;</b></div>
46-
47-
<div class="site-header">
48-
<a href="{{ '/' | absolute_url }}" class="site-title lh-tight">{% include title.html %}</a>
49-
<a href="#" id="menu-button" class="site-button">
50-
<svg viewBox="0 0 24 24" class="icon"><use xlink:href="#svg-menu"></use></svg>
51-
</a>
52-
</div>
53-
<nav role="navigation" aria-label="Main" id="site-nav" class="site-nav">
54-
{% if site.just_the_docs.collections %}
55-
{% assign collections_size = site.just_the_docs.collections | size %}
56-
{% for collection_entry in site.just_the_docs.collections %}
57-
{% assign collection_key = collection_entry[0] %}
58-
{% assign collection_value = collection_entry[1] %}
59-
{% assign collection = site[collection_key] %}
60-
{% if collection_value.nav_exclude != true %}
61-
{% if collections_size > 1 %}
62-
<div class="nav-category">{{ collection_value.name }}</div>
63-
{% endif %}
64-
{% include nav.html pages=collection %}
65-
{% endif %}
66-
{% endfor %}
67-
{% else %}
68-
{% include nav.html pages=site.html_pages %}
69-
{% endif %}
70-
</nav>
71-
<footer class="site-footer">
72-
This site uses <a href="https://github.com/pmarsceill/just-the-docs">Just the Docs</a>, a documentation theme for Jekyll.
73-
</footer>
74-
</div>
10+
<a class="skip-to-main" href="#main-content">Skip to main content</a>
11+
{% include icons/icons.html %}
12+
{% if page.nav_enabled == true %}
13+
{% include components/sidebar.html %}
14+
{% elsif layout.nav_enabled == true and page.nav_enabled == nil %}
15+
{% include components/sidebar.html %}
16+
{% elsif site.nav_enabled != false and layout.nav_enabled == nil and page.nav_enabled == nil %}
17+
{% include components/sidebar.html %}
18+
{% endif %}
7519
<div class="main" id="top">
76-
<div id="main-header" class="main-header">
77-
{% if site.search_enabled != false %}
78-
<div class="search">
79-
<div class="search-input-wrap">
80-
<input type="text" id="search-input" class="search-input" tabindex="0" placeholder="Search {{ site.title }}" aria-label="Search {{ site.title }}" autocomplete="off">
81-
<label for="search-input" class="search-label"><svg viewBox="0 0 24 24" class="search-icon"><use xlink:href="#svg-search"></use></svg></label>
82-
</div>
83-
<div id="search-results" class="search-results"></div>
84-
</div>
85-
{% endif %}
86-
{% include header_custom.html %}
87-
{% if site.aux_links %}
88-
<nav aria-label="Auxiliary" class="aux-nav">
89-
<ul class="aux-nav-list">
90-
{% for link in site.aux_links %}
91-
<li class="aux-nav-list-item">
92-
<a href="{{ link.last }}" class="site-button"
93-
{% if site.aux_links_new_tab %}
94-
target="_blank" rel="noopener noreferrer"
95-
{% endif %}
96-
>
97-
{{ link.first }}
98-
</a>
99-
</li>
100-
{% endfor %}
101-
</ul>
102-
</nav>
103-
{% endif %}
104-
</div>
105-
<div id="main-content-wrap" class="main-content-wrap">
106-
{% unless page.url == "/" %}
107-
{% if page.parent %}
108-
{%- for node in pages_list -%}
109-
{%- if node.parent == nil -%}
110-
{%- if page.parent == node.title or page.grand_parent == node.title -%}
111-
{%- assign first_level_url = node.url | absolute_url -%}
112-
{%- endif -%}
113-
{%- if node.has_children -%}
114-
{%- assign children_list = pages_list | where: "parent", node.title -%}
115-
{%- for child in children_list -%}
116-
{%- if page.url == child.url or page.parent == child.title -%}
117-
{%- assign second_level_url = child.url | absolute_url -%}
118-
{%- endif -%}
119-
{%- endfor -%}
120-
{%- endif -%}
121-
{%- endif -%}
122-
{%- endfor -%}
123-
<nav aria-label="Breadcrumb" class="breadcrumb-nav">
124-
<ol class="breadcrumb-nav-list">
125-
{% if page.grand_parent %}
126-
<li class="breadcrumb-nav-list-item"><a href="{{ first_level_url }}">{{ page.grand_parent }}</a></li>
127-
<li class="breadcrumb-nav-list-item"><a href="{{ second_level_url }}">{{ page.parent }}</a></li>
128-
{% else %}
129-
<li class="breadcrumb-nav-list-item"><a href="{{ first_level_url }}">{{ page.parent }}</a></li>
130-
{% endif %}
131-
<li class="breadcrumb-nav-list-item"><span>{{ page.title }}</span></li>
132-
</ol>
133-
</nav>
134-
{% endif %}
135-
{% endunless %}
136-
<div id="main-content" class="main-content" role="main">
137-
<h1>{{ page.title }}</h1>
138-
{% if site.heading_anchors != false %}
139-
{% include vendor/anchor_headings.html html=content beforeHeading="true" anchorBody="<svg viewBox=\"0 0 16 16\" aria-hidden=\"true\"><use xlink:href=\"#svg-link\"></use></svg>" anchorClass="anchor-heading" anchorAttrs="aria-labelledby=\"%html_id%\"" %}
140-
{% else %}
141-
{{ content }}
142-
{% endif %}
143-
144-
{% if page.has_children == true and page.has_toc != false %}
145-
<hr>
146-
<h2 class="text-delta">Table of contents</h2>
147-
<ul>
148-
{%- assign children_list = pages_list | where: "parent", page.title | where: "grand_parent", page.parent -%}
149-
{% for child in children_list %}
150-
<li>
151-
<a href="{{ child.url | absolute_url }}">{{ child.title }}</a>{% if child.summary %} - {{ child.summary }}{% endif %}
152-
</li>
153-
{% endfor %}
154-
</ul>
155-
{% endif %}
156-
157-
{% capture footer_custom %}
158-
{%- include footer_custom.html -%}
159-
{% endcapture %}
160-
{% if footer_custom != "" or site.last_edit_timestamp or site.gh_edit_link %}
161-
<hr>
162-
<footer>
163-
{% if site.back_to_top %}
164-
<p><a href="#top" id="back-to-top">{{ site.back_to_top_text }}</a></p>
165-
{% endif %}
166-
167-
{{ footer_custom }}
168-
169-
{% if site.last_edit_timestamp or site.gh_edit_link %}
170-
<div class="d-flex mt-2">
171-
{% if site.last_edit_timestamp and site.last_edit_time_format and page.last_modified_date %}
172-
<p class="text-small text-grey-dk-000 mb-0 mr-2">
173-
Page last modified: <span class="d-inline-block">{{ page.last_modified_date | date: site.last_edit_time_format }}</span>.
174-
</p>
175-
{% endif %}
176-
{% if
177-
site.gh_edit_link and
178-
site.gh_edit_link_text and
179-
site.gh_edit_repository and
180-
site.gh_edit_branch and
181-
site.gh_edit_view_mode
182-
%}
183-
<p class="text-small text-grey-dk-000 mb-0">
184-
<a href="{{ site.gh_edit_repository }}/{{ site.gh_edit_view_mode }}/{{ site.gh_edit_branch }}{% if site.gh_edit_source %}/{{ site.gh_edit_source }}{% endif %}/{{ page.path }}" id="edit-this-page">{{ site.gh_edit_link_text }}</a>
185-
</p>
186-
{% endif %}
187-
</div>
188-
{% endif %}
189-
</footer>
190-
{% endif %}
20+
{% include components/header.html %}
21+
<div class="main-content-wrap">
22+
{% include components/breadcrumbs.html %}
23+
<div id="main-content" class="main-content">
24+
<main>
25+
<h1>{{ page.title }}</h1>
26+
{% if site.heading_anchors != false %}
27+
{% include vendor/anchor_headings.html html=content beforeHeading="true" anchorBody="<svg viewBox=\"0 0 16 16\" aria-hidden=\"true\"><use xlink:href=\"#svg-link\"></use></svg>" anchorClass="anchor-heading" anchorAttrs="aria-labelledby=\"%html_id%\"" %}
28+
{% else %}
29+
{{ content }}
30+
{% endif %}
19131

32+
{% if page.has_toc != false %}
33+
{% include components/children_nav.html %}
34+
{% endif %}
35+
</main>
36+
{% include components/footer.html %}
19237
</div>
19338
</div>
194-
19539
{% if site.search_enabled != false %}
196-
{% if site.search.button %}
197-
<a href="#" id="search-button" class="search-button">
198-
<svg viewBox="0 0 24 24" class="icon"><use xlink:href="#svg-search"></use></svg>
199-
</a>
200-
{% endif %}
201-
202-
<div class="search-overlay"></div>
40+
{% include components/search_footer.html %}
20341
{% endif %}
20442
</div>
43+
44+
{% if site.mermaid %}
45+
{% include components/mermaid.html %}
46+
{% endif %}
20547
</body>
20648
</html>

0 commit comments

Comments
 (0)