just-the-docs 0.4.0.rc3 → 0.4.0.rc4

Sign up to get free protection for your applications and to get access to all the features.
data/_includes/nav.html CHANGED
@@ -39,21 +39,23 @@
39
39
  pages.
40
40
  {%- endcomment -%}
41
41
 
42
- {%- assign unsorted_pages = title_pages
43
- | where_exp: "item", "item.parent == nil"
44
- | where_exp: "item", "item.nav_exclude == true"-%}
45
- {%- assign title_pages_size = title_pages.size -%}
46
- {%- assign unsorted_pages_percent = unsorted_pages.size
47
- | times: 100 | divided_by: title_pages_size -%}
48
- {%- if unsorted_pages_percent > 50 -%}
49
- {%- assign sorted_pages = "" | split: "" -%}
50
- {%- for item in title_pages -%}
51
- {%- if item.nav_exclude != true or item.parent -%}
52
- {%- assign sorted_pages = sorted_pages | push: item -%}
53
- {%- endif -%}
54
- {%- endfor -%}
55
- {%- assign title_pages = sorted_pages -%}
56
- {%- endif -%}
42
+ {%- unless title_pages == empty -%}
43
+ {%- assign unsorted_pages = title_pages
44
+ | where_exp: "item", "item.parent == nil"
45
+ | where_exp: "item", "item.nav_exclude == true" -%}
46
+ {%- assign title_pages_size = title_pages.size -%}
47
+ {%- assign unsorted_pages_percent = unsorted_pages.size
48
+ | times: 100 | divided_by: title_pages_size -%}
49
+ {%- if unsorted_pages_percent > 50 -%}
50
+ {%- assign sorted_pages = "" | split: "" -%}
51
+ {%- for item in title_pages -%}
52
+ {%- if item.nav_exclude != true or item.parent -%}
53
+ {%- assign sorted_pages = sorted_pages | push: item -%}
54
+ {%- endif -%}
55
+ {%- endfor -%}
56
+ {%- assign title_pages = sorted_pages -%}
57
+ {%- endif -%}
58
+ {%- endunless -%}
57
59
 
58
60
  {%- assign nav_order_pages = title_pages
59
61
  | where_exp: "item", "item.nav_order != nil" -%}
@@ -130,12 +132,36 @@
130
132
  {%- comment -%}
131
133
  The order of sibling pages in `pages_list` determines the order of display of
132
134
  links to them in lists of navigation links and in auto-generated TOCs.
135
+
136
+ Note that Liquid evaluates conditions from right to left (and it does not allow
137
+ the use of parentheses). Some conditions are not so easy to express clearly...
138
+
139
+ For example, consider the following condition:
140
+
141
+ C: page.collection = = include.key and
142
+ page.url = = node.url or
143
+ page.grand_parent = = node.title or
144
+ page.parent = = node.title and
145
+ page.grand_parent = = nil
146
+
147
+ Here, `node` is a first-level page. The last part of the condition
148
+ -- namely: `page.parent = = node.title and page.grand_parent = = nil` --
149
+ is evaluated first; it holds if and only if `page` is a child of `node`.
150
+
151
+ The condition `page.grand_parent = = node.title or ...` holds when
152
+ `page` is a grandchild of node, OR `...` holds.
153
+
154
+ The condition `page.url = = node.url or ...` holds when
155
+ `page` is `node`, OR `...` holds.
156
+
157
+ The condition C: `page.collection = = include.key and ...` holds when we are
158
+ generating the nav links for a collection that includes `page`, AND `...` holds.
133
159
  {%- endcomment -%}
134
160
 
135
161
  <ul class="nav-list">
136
162
  {%- for node in first_level_pages -%}
137
163
  {%- unless node.nav_exclude -%}
138
- <li class="nav-list-item{% if page.collection == include.key and page.url == node.url or page.parent == node.title or page.grand_parent == node.title %} active{% endif %}">
164
+ <li class="nav-list-item{% if page.collection == include.key and page.url == node.url or page.grand_parent == node.title or page.parent == node.title and page.grand_parent == nil %} active{% endif %}">
139
165
  {%- if node.has_children -%}
140
166
  <a href="#" class="nav-list-expander" aria-label="toggle links in {{ node.title }} category">
141
167
  <svg viewBox="0 0 24 24"><use xlink:href="#svg-arrow-right"></use></svg>
@@ -145,7 +171,7 @@
145
171
  {%- if node.has_children -%}
146
172
  {%- assign children_list = second_level_pages
147
173
  | where: "parent", node.title -%}
148
- {%- if node.child_nav_order == 'desc' -%}
174
+ {%- if node.child_nav_order == 'desc' or node.child_nav_order == 'reversed' -%}
149
175
  {%- assign children_list = children_list | reverse -%}
150
176
  {%- endif -%}
151
177
  <ul class="nav-list ">
@@ -162,7 +188,7 @@
162
188
  {%- assign grand_children_list = third_level_pages
163
189
  | where: "parent", child.title
164
190
  | where: "grand_parent", node.title -%}
165
- {%- if child.child_nav_order == 'desc' -%}
191
+ {%- if child.child_nav_order == 'desc' or child.child_nav_order == 'reversed' -%}
166
192
  {%- assign grand_children_list = grand_children_list | reverse -%}
167
193
  {%- endif -%}
168
194
  <ul class="nav-list">
@@ -183,15 +209,6 @@
183
209
  </li>
184
210
  {%- endunless -%}
185
211
  {%- endfor -%}
186
- {%- assign nav_external_links = site.nav_external_links -%}
187
- {%- for node in nav_external_links -%}
188
- <li class="nav-list-item external">
189
- <a href="{{ node.url | absolute_url }}" class="nav-list-link external">
190
- {{ node.title }}
191
- {% unless node.hide_icon %}<svg viewBox="0 0 24 24" aria-labelledby="svg-external-link-title"><use xlink:href="#svg-external-link"></use></svg>{% endunless %}
192
- </a>
193
- </li>
194
- {%- endfor -%}
195
212
  </ul>
196
213
 
197
214
  {%- comment -%}
@@ -203,7 +220,8 @@
203
220
  the page's top-level breadcrumb (if any), and `second_level_url` to that used
204
221
  in the page's second-level breadcrumb (if any).
205
222
 
206
- For pages with children, the code also sets `toc_list` to the list of child pages.
223
+ For pages with children, the code also sets `toc_list` to the list of child pages,
224
+ reversing the order if needed.
207
225
  {%- endcomment -%}
208
226
 
209
227
  {%- if page.collection == include.key -%}
@@ -225,8 +243,8 @@
225
243
  {%- if page.has_children == true and page.has_toc != false -%}
226
244
  {%- assign toc_list = pages_list
227
245
  | where: "parent", page.title
228
- | where: "grand_parent", page.parent -%}
229
- {%- if page.child_nav_order == "desc" -%}
246
+ | where_exp: "item", "item.grand_parent == page.parent" -%}
247
+ {%- if page.child_nav_order == 'desc' or page.child_nav_order == 'reversed' -%}
230
248
  {%- assign toc_list = toc_list | reverse -%}
231
249
  {%- endif -%}
232
250
  {%- endif -%}
@@ -24,7 +24,7 @@
24
24
  OTHER DEALINGS IN THE SOFTWARE.
25
25
  {% endcomment %}
26
26
  {% comment %}
27
- Version 1.0.7
27
+ Version 1.0.12
28
28
  https://github.com/allejo/jekyll-anchor-headings
29
29
 
30
30
  "Be the pull request you wish to see in the world." ~Ben Balter
@@ -37,6 +37,8 @@
37
37
 
38
38
  Optional Parameters:
39
39
  * beforeHeading (bool) : false - Set to true if the anchor should be placed _before_ the heading's content
40
+ * headerAttrs (string) : '' - Any custom HTML attributes that will be added to the heading tag; you may NOT use `id`;
41
+ the `%heading%` and `%html_id%` placeholders are available
40
42
  * anchorAttrs (string) : '' - Any custom HTML attributes that will be added to the `<a>` tag; you may NOT use `href`, `class` or `title`;
41
43
  the `%heading%` and `%html_id%` placeholders are available
42
44
  * anchorBody (string) : '' - The content that will be placed inside the anchor; the `%heading%` placeholder is available
@@ -46,6 +48,7 @@
46
48
  * h_max (int) : 6 - The maximum header level to build an anchor for; any header greater than this value will be ignored
47
49
  * bodyPrefix (string) : '' - Anything that should be inserted inside of the heading tag _before_ its anchor and content
48
50
  * bodySuffix (string) : '' - Anything that should be inserted inside of the heading tag _after_ its anchor and content
51
+ * generateId (true) : false - Set to true if a header without id should generate an id to use.
49
52
 
50
53
  Output:
51
54
  The original HTML with the addition of anchors inside of all of the h1-h6 headings.
@@ -54,6 +57,7 @@
54
57
  {% assign minHeader = include.h_min | default: 1 %}
55
58
  {% assign maxHeader = include.h_max | default: 6 %}
56
59
  {% assign beforeHeading = include.beforeHeading %}
60
+ {% assign headerAttrs = include.headerAttrs %}
57
61
  {% assign nodes = include.html | split: '<h' %}
58
62
 
59
63
  {% capture edited_headings %}{% endcapture %}
@@ -84,17 +88,41 @@
84
88
 
85
89
  {% capture _closingTag %}</h{{ headerLevel }}>{% endcapture %}
86
90
  {% assign _workspace = node | split: _closingTag %}
87
- {% assign _idWorkspace = _workspace[0] | split: 'id="' %}
88
- {% assign _idWorkspace = _idWorkspace[1] | split: '"' %}
89
- {% assign html_id = _idWorkspace[0] %}
90
-
91
91
  {% capture _hAttrToStrip %}{{ _workspace[0] | split: '>' | first }}>{% endcapture %}
92
92
  {% assign header = _workspace[0] | replace: _hAttrToStrip, '' %}
93
+ {% assign escaped_header = header | strip_html | strip %}
94
+
95
+ {% assign _classWorkspace = _workspace[0] | split: 'class="' %}
96
+ {% assign _classWorkspace = _classWorkspace[1] | split: '"' %}
97
+ {% assign _html_class = _classWorkspace[0] %}
98
+
99
+ {% if _html_class contains "no_anchor" %}
100
+ {% assign skip_anchor = true %}
101
+ {% else %}
102
+ {% assign skip_anchor = false %}
103
+ {% endif %}
104
+
105
+ {% assign _idWorkspace = _workspace[0] | split: 'id="' %}
106
+ {% if _idWorkspace[1] %}
107
+ {% assign _idWorkspace = _idWorkspace[1] | split: '"' %}
108
+ {% assign html_id = _idWorkspace[0] %}
109
+ {% elsif include.generateId %}
110
+ <!-- If the header did not have an id we create one. -->
111
+ {% assign html_id = escaped_header | slugify %}
112
+ {% if html_id == "" %}
113
+ {% assign html_id = false %}
114
+ {% endif %}
115
+ {% capture headerAttrs %}{{ headerAttrs }} id="%html_id%"{% endcapture %}
116
+ {% endif %}
93
117
 
94
118
  <!-- Build the anchor to inject for our heading -->
95
119
  {% capture anchor %}{% endcapture %}
96
120
 
97
- {% if html_id and headerLevel >= minHeader and headerLevel <= maxHeader %}
121
+ {% if skip_anchor == false and html_id and headerLevel >= minHeader and headerLevel <= maxHeader %}
122
+ {% if headerAttrs %}
123
+ {% capture _hAttrToStrip %}{{ _hAttrToStrip | split: '>' | first }} {{ headerAttrs | replace: '%heading%', escaped_header | replace: '%html_id%', html_id }}>{% endcapture %}
124
+ {% endif %}
125
+
98
126
  {% capture anchor %}href="#{{ html_id }}"{% endcapture %}
99
127
 
100
128
  {% if include.anchorClass %}
@@ -102,14 +130,14 @@
102
130
  {% endif %}
103
131
 
104
132
  {% if include.anchorTitle %}
105
- {% capture anchor %}{{ anchor }} title="{{ include.anchorTitle | replace: '%heading%', header }}"{% endcapture %}
133
+ {% capture anchor %}{{ anchor }} title="{{ include.anchorTitle | replace: '%heading%', escaped_header }}"{% endcapture %}
106
134
  {% endif %}
107
135
 
108
136
  {% if include.anchorAttrs %}
109
- {% capture anchor %}{{ anchor }} {{ include.anchorAttrs | replace: '%heading%', header | replace: '%html_id%', html_id }}{% endcapture %}
137
+ {% capture anchor %}{{ anchor }} {{ include.anchorAttrs | replace: '%heading%', escaped_header | replace: '%html_id%', html_id }}{% endcapture %}
110
138
  {% endif %}
111
139
 
112
- {% capture anchor %}<a {{ anchor }}>{{ include.anchorBody | replace: '%heading%', header | default: '' }}</a>{% endcapture %}
140
+ {% capture anchor %}<a {{ anchor }}>{{ include.anchorBody | replace: '%heading%', escaped_header | default: '' }}</a>{% endcapture %}
113
141
 
114
142
  <!-- In order to prevent adding extra space after a heading, we'll let the 'anchor' value contain it -->
115
143
  {% if beforeHeading %}
@@ -120,15 +148,15 @@
120
148
  {% endif %}
121
149
 
122
150
  {% capture new_heading %}
123
- <h{{ _hAttrToStrip }}
124
- {{ include.bodyPrefix }}
125
- {% if beforeHeading %}
126
- {{ anchor }}{{ header }}
127
- {% else %}
128
- {{ header }}{{ anchor }}
129
- {% endif %}
130
- {{ include.bodySuffix }}
131
- </h{{ headerLevel }}>
151
+ <h{{ _hAttrToStrip }}
152
+ {{ include.bodyPrefix }}
153
+ {% if beforeHeading %}
154
+ {{ anchor }}{{ header }}
155
+ {% else %}
156
+ {{ header }}{{ anchor }}
157
+ {% endif %}
158
+ {{ include.bodySuffix }}
159
+ </h{{ headerLevel }}>
132
160
  {% endcapture %}
133
161
 
134
162
  <!--
@@ -8,148 +8,12 @@ layout: table_wrappers
8
8
  {% include head.html %}
9
9
  <body>
10
10
  <a class="skip-to-main" href="#main-content">Skip to main content</a>
11
- <svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
12
- <symbol id="svg-link" viewBox="0 0 24 24">
13
- <title>Link</title>
14
- <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">
15
- <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>
16
- </svg>
17
- </symbol>
18
- <symbol id="svg-search" viewBox="0 0 24 24">
19
- <title>Search</title>
20
- <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">
21
- <circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line>
22
- </svg>
23
- </symbol>
24
- <symbol id="svg-menu" viewBox="0 0 24 24">
25
- <title>Menu</title>
26
- <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">
27
- <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>
28
- </svg>
29
- </symbol>
30
- <symbol id="svg-arrow-right" viewBox="0 0 24 24">
31
- <title>Expand</title>
32
- <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">
33
- <polyline points="9 18 15 12 9 6"></polyline>
34
- </svg>
35
- </symbol>
36
- <symbol id="svg-doc" viewBox="0 0 24 24">
37
- <title>Document</title>
38
- <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">
39
- <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>
40
- </svg>
41
- </symbol>
42
- {% include icons/external_link.html %}
43
- </svg>
44
-
45
- <div class="side-bar">
46
- <div class="site-header">
47
- <a href="{{ '/' | relative_url }}" class="site-title lh-tight">{% include title.html %}</a>
48
- <a href="#" id="menu-button" class="site-button">
49
- <svg viewBox="0 0 24 24" class="icon"><use xlink:href="#svg-menu"></use></svg>
50
- </a>
51
- </div>
52
- <nav aria-label="Main" id="site-nav" class="site-nav">
53
- {% assign pages_top_size = site.html_pages
54
- | where_exp:"item", "item.title != nil"
55
- | where_exp:"item", "item.parent == nil"
56
- | where_exp:"item", "item.nav_exclude != true"
57
- | size %}
58
- {% if pages_top_size > 0 %}
59
- {% include nav.html pages=site.html_pages key=nil %}
60
- {% endif %}
61
- {% if site.just_the_docs.collections %}
62
- {% assign collections_size = site.just_the_docs.collections | size %}
63
- {% for collection_entry in site.just_the_docs.collections %}
64
- {% assign collection_key = collection_entry[0] %}
65
- {% assign collection_value = collection_entry[1] %}
66
- {% assign collection = site[collection_key] %}
67
- {% if collection_value.nav_exclude != true %}
68
- {% if collections_size > 1 or pages_top_size > 0 %}
69
- {% if collection_value.nav_fold == true %}
70
- <ul class="nav-list nav-category-list">
71
- <li class="nav-list-item{% if page.collection == collection_key %} active{% endif %}">
72
- {%- if collection.size > 0 -%}
73
- <a href="#" class="nav-list-expander"><svg viewBox="0 0 24 24"><use xlink:href="#svg-arrow-right"></use></svg></a>
74
- {%- endif -%}
75
- <div class="nav-category">{{ collection_value.name }}</div>
76
- {% include nav.html pages=collection key=collection_key %}
77
- </li>
78
- </ul>
79
- {% else %}
80
- <div class="nav-category">{{ collection_value.name }}</div>
81
- {% include nav.html pages=collection key=collection_key %}
82
- {% endif %}
83
- {% else %}
84
- {% include nav.html pages=collection key=collection_key %}
85
- {% endif %}
86
- {% endif %}
87
- {% endfor %}
88
- {% endif %}
89
- </nav>
90
-
91
- {% capture nav_footer_custom %}
92
- {%- include nav_footer_custom.html -%}
93
- {% endcapture %}
94
- {% if nav_footer_custom != "" %}
95
- {{ nav_footer_custom }}
96
- {% else %}
97
- <footer class="site-footer">
98
- This site uses <a href="https://github.com/just-the-docs/just-the-docs">Just the Docs</a>, a documentation theme for Jekyll.
99
- </footer>
100
- {% endif %}
101
- </div>
11
+ {% include icons/icons.html %}
12
+ {% include components/sidebar.html %}
102
13
  <div class="main" id="top">
103
- <div id="main-header" class="main-header">
104
- {% if site.search_enabled != false %}
105
-
106
- {% capture search_placeholder %}{% include search_placeholder_custom.html %}{% endcapture %}
107
-
108
- <div class="search">
109
- <div class="search-input-wrap">
110
- <input type="text" id="search-input" class="search-input" tabindex="0" placeholder="{{ search_placeholder | strip_html | strip }}" aria-label="{{ search_placeholder | strip_html| strip }}" autocomplete="off">
111
- <label for="search-input" class="search-label"><svg viewBox="0 0 24 24" class="search-icon"><use xlink:href="#svg-search"></use></svg></label>
112
- </div>
113
- <div id="search-results" class="search-results"></div>
114
- </div>
115
- {% else %}
116
- <div></div>
117
- {% endif %}
118
- {% include header_custom.html %}
119
- {% if site.aux_links %}
120
- <nav aria-label="Auxiliary" class="aux-nav">
121
- <ul class="aux-nav-list">
122
- {% for link in site.aux_links %}
123
- <li class="aux-nav-list-item">
124
- <a href="{{ link.last }}" class="site-button"
125
- {% if site.aux_links_new_tab %}
126
- target="_blank" rel="noopener noreferrer"
127
- {% endif %}
128
- >
129
- {{ link.first }}
130
- </a>
131
- </li>
132
- {% endfor %}
133
- </ul>
134
- </nav>
135
- {% endif %}
136
- </div>
14
+ {% include components/header.html %}
137
15
  <div id="main-content-wrap" class="main-content-wrap">
138
- {% unless page.url == "/" %}
139
- {% if page.parent %}
140
- <nav aria-label="Breadcrumb" class="breadcrumb-nav">
141
- <ol class="breadcrumb-nav-list">
142
- {% if page.grand_parent %}
143
- <li class="breadcrumb-nav-list-item"><a href="{{ first_level_url }}">{{ page.grand_parent }}</a></li>
144
- <li class="breadcrumb-nav-list-item"><a href="{{ second_level_url }}">{{ page.parent }}</a></li>
145
- {% else %}
146
- <li class="breadcrumb-nav-list-item"><a href="{{ first_level_url }}">{{ page.parent }}</a></li>
147
- {% endif %}
148
- <li class="breadcrumb-nav-list-item"><span>{{ page.title }}</span></li>
149
- </ol>
150
- </nav>
151
- {% endif %}
152
- {% endunless %}
16
+ {% include components/breadcrumbs.html %}
153
17
  <div id="main-content" class="main-content" role="main">
154
18
  {% if site.heading_anchors != false %}
155
19
  {% 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%\"" %}
@@ -158,72 +22,20 @@ layout: table_wrappers
158
22
  {% endif %}
159
23
 
160
24
  {% if page.has_children == true and page.has_toc != false %}
161
- <hr>
162
- {% include toc_heading_custom.html %}
163
- <ul>
164
- {% for child in toc_list %}
165
- <li>
166
- <a href="{{ child.url | relative_url }}">{{ child.title }}</a>{% if child.summary %} - {{ child.summary }}{% endif %}
167
- </li>
168
- {% endfor %}
169
- </ul>
25
+ {% include components/children_nav.html toc_list=toc_list %}
170
26
  {% endif %}
171
27
 
172
- {% capture footer_custom %}
173
- {%- include footer_custom.html -%}
174
- {% endcapture %}
175
- {% if footer_custom != "" or site.last_edit_timestamp or site.gh_edit_link %}
176
- <hr>
177
- <footer>
178
- {% if site.back_to_top %}
179
- <p><a href="#top" id="back-to-top">{{ site.back_to_top_text }}</a></p>
180
- {% endif %}
181
-
182
- {{ footer_custom }}
183
-
184
- {% if site.last_edit_timestamp or site.gh_edit_link %}
185
- <div class="d-flex mt-2">
186
- {% if site.last_edit_timestamp and site.last_edit_time_format and page.last_modified_date %}
187
- <p class="text-small text-grey-dk-000 mb-0 mr-2">
188
- Page last modified: <span class="d-inline-block">{{ page.last_modified_date | date: site.last_edit_time_format }}</span>.
189
- </p>
190
- {% endif %}
191
- {% if
192
- site.gh_edit_link and
193
- site.gh_edit_link_text and
194
- site.gh_edit_repository and
195
- site.gh_edit_branch and
196
- site.gh_edit_view_mode
197
- %}
198
- <p class="text-small text-grey-dk-000 mb-0">
199
- <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 %}{% if page.collection and site.collections_dir %}/{{ site.collections_dir }}{% endif %}/{{ page.path }}" id="edit-this-page">{{ site.gh_edit_link_text }}</a>
200
- </p>
201
- {% endif %}
202
- </div>
203
- {% endif %}
204
- </footer>
205
- {% endif %}
28
+ {% include components/footer.html %}
206
29
 
207
30
  </div>
208
31
  </div>
209
-
210
32
  {% if site.search_enabled != false %}
211
- {% if site.search.button %}
212
- <a href="#" id="search-button" class="search-button">
213
- <svg viewBox="0 0 24 24" class="icon"><use xlink:href="#svg-search"></use></svg>
214
- </a>
215
- {% endif %}
216
-
217
- <div class="search-overlay"></div>
33
+ {% include components/search_footer.html %}
218
34
  {% endif %}
219
35
  </div>
220
36
 
221
37
  {% if site.mermaid %}
222
- <script>
223
- var config = {% include mermaid_config.js %};
224
- mermaid.initialize(config);
225
- window.mermaid.init(undefined, document.querySelectorAll('.language-mermaid'));
226
- </script>
38
+ {% include components/mermaid.html %}
227
39
  {% endif %}
228
40
  </body>
229
41
  </html>
@@ -0,0 +1,60 @@
1
+ ---
2
+ layout: table_wrappers
3
+ ---
4
+
5
+ <!DOCTYPE html>
6
+
7
+ <html lang="{{ site.lang | default: 'en-US' }}">
8
+ {% include head.html %}
9
+ <body>
10
+ <a class="skip-to-main" href="#main-content">Skip to main content</a>
11
+ {% include icons/icons.html %}
12
+ {% comment %}
13
+ This is a bandaid fix to properly render breadcrumbs; as of now, there is some variable leakage between the sidebar component (which computes parents, grandparents) and the breadcrumbs component. We plan to remove this in a future release to deduplicate code.
14
+
15
+ For more context, see https://github.com/just-the-docs/just-the-docs/pull/1058#discussion_r1057014053
16
+ {% endcomment %}
17
+ {% capture nav %}
18
+ {% assign pages_top_size = site.html_pages
19
+ | where_exp:"item", "item.title != nil"
20
+ | where_exp:"item", "item.parent == nil"
21
+ | where_exp:"item", "item.nav_exclude != true"
22
+ | size %}
23
+ {% if pages_top_size > 0 %}
24
+ {% include nav.html pages=site.html_pages key=nil %}
25
+ {% endif %}
26
+ {% if site.just_the_docs.collections %}
27
+ {% assign collections_size = site.just_the_docs.collections | size %}
28
+ {% for collection_entry in site.just_the_docs.collections %}
29
+ {% assign collection_key = collection_entry[0] %}
30
+ {% assign collection_value = collection_entry[1] %}
31
+ {% assign collection = site[collection_key] %}
32
+ {% if collection_value.nav_exclude != true %}
33
+ {% include nav.html pages=collection key=collection_key %}
34
+ {% endif %}
35
+ {% endfor %}
36
+ {% endif %}
37
+ {% endcapture %}
38
+ <div id="main-content-wrap" class="main-content-wrap" id="top">
39
+ {% include components/breadcrumbs.html %}
40
+ <div id="main-content" class="main-content" role="main">
41
+ {% if site.heading_anchors != false %}
42
+ {% 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%\"" %}
43
+ {% else %}
44
+ {{ content }}
45
+ {% endif %}
46
+
47
+ {% if page.has_children == true and page.has_toc != false %}
48
+ {% include components/children_nav.html toc_list=toc_list %}
49
+ {% endif %}
50
+
51
+ {% include components/footer.html %}
52
+
53
+ </div>
54
+ </div>
55
+
56
+ {% if site.mermaid %}
57
+ {% include components/mermaid.html %}
58
+ {% endif %}
59
+ </body>
60
+ </html>
data/_sass/buttons.scss CHANGED
@@ -4,10 +4,7 @@
4
4
  .btn {
5
5
  display: inline-block;
6
6
  box-sizing: border-box;
7
- padding-top: 0.3em;
8
- padding-right: 1em;
9
- padding-bottom: 0.3em;
10
- padding-left: 1em;
7
+ padding: 0.3em 1em;
11
8
  margin: 0;
12
9
  font-family: inherit;
13
10
  font-size: inherit;