Skip to content

Commit 34eaebf

Browse files
committed
fix: add anchor_icon component to avoid pre-commit prettier issue, remove components directory, pre-commit run
1 parent b740121 commit 34eaebf

7 files changed

Lines changed: 50 additions & 56 deletions

File tree

docs/_config.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,3 @@ aux_links:
1313
aux_links_new_tab: true
1414

1515
logo: "https://raw.githubusercontent.com/UCL-ARC/python-tooling/main/images/logo.svg"
16-
17-
# defaults:
18-
# -
19-
# scope:
20-
# path: "" # Means apply to all files
21-
# values:
22-
# layout: "default-custom" # Name of your custom layout
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<svg viewBox="0 0 16 16" aria-hidden="true">
2+
<use xlink:href="#svg-link"></use>
3+
</svg>

docs/_includes/components/sidebar.html

Lines changed: 0 additions & 22 deletions
This file was deleted.
File renamed without changes.

docs/_includes/sidebar.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{%- comment -%} Include as: {%- include components/sidebar.html -%} Depends on:
2+
page(?), site. Results in: HTML for the side bar. Includes: title.html,
3+
components/site_nav.html, nav_footer_custom.html Overwrites: nav_footer_custom.
4+
Should not be cached, because nav_footer_custom.html might depend on page. {%-
5+
endcomment -%}
6+
7+
<div class="side-bar">
8+
<div class="site-header" role="banner">
9+
<a href="{{ '/' | relative_url }}" class="site-title lh-tight"
10+
>{% include title.html %}</a
11+
>
12+
<button
13+
id="menu-button"
14+
class="site-button btn-reset"
15+
aria-label="Toggle menu"
16+
aria-pressed="false"
17+
>
18+
<svg viewBox="0 0 24 24" class="icon" aria-hidden="true">
19+
<use xlink:href="#svg-menu"></use>
20+
</svg>
21+
</button>
22+
</div>
23+
24+
{% include_cached components/site_nav.html %}
25+
</div>

docs/_layouts/default.html

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
1-
<!DOCTYPE html>
1+
<!doctype html>
22
<html lang="{{ site.lang | default: 'en-US' }}">
33
{% include head.html %}
44
<body>
55
<a class="skip-to-main" href="#main-content">Skip to main content</a>
6-
{% include icons/icons.html %}
7-
8-
{% if page.nav_enabled == true %}
9-
{% include components/sidebar.html %}
10-
{% elsif layout.nav_enabled == true and page.nav_enabled == nil %}
11-
{% include components/sidebar.html %}
12-
{% elsif site.nav_enabled != false and layout.nav_enabled == nil and page.nav_enabled == nil %}
13-
{% include components/sidebar.html %}
14-
{% endif %}
6+
{% include icons/icons.html %} {% if page.nav_enabled == true %} {% include
7+
sidebar.html %} {% elsif layout.nav_enabled == true and page.nav_enabled ==
8+
nil %} {% include sidebar.html %} {% elsif site.nav_enabled != false and
9+
layout.nav_enabled == nil and page.nav_enabled == nil %} {% include
10+
sidebar.html %} {% endif %}
1511

1612
<div class="main" id="top">
1713
{% include components/header.html %}
@@ -20,30 +16,29 @@
2016
{% include components/breadcrumbs.html %}
2117
<div id="main-content" class="main-content">
2218
<main>
23-
{% if site.heading_anchors != false %}
24-
{% 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%\"" %}
25-
{% else %}
26-
{{ content }}
27-
{% endif %}
28-
29-
{% if page.has_toc != false %}
30-
{% include components/children_nav.html %}
31-
{% endif %}
19+
{% if site.heading_anchors != false %} {% capture raw_anchor_svg %}
20+
{% include components/anchor_icon.html %} {% endcapture %} {% assign
21+
anchor_svg = raw_anchor_svg | strip_newlines %} {% include
22+
vendor/anchor_headings.html html=content beforeHeading="true"
23+
anchorBody=anchor_svg anchorClass="anchor-heading"
24+
anchorAttrs="aria-labelledby='%html_id%'" %} {% else %} {{ content
25+
}} {% endif %} {% if page.has_toc != false %} {% include
26+
components/children_nav.html %} {% endif %}
3227
</main>
3328
</div>
3429
</div>
3530

3631
<footer class="site-footer">
37-
This site uses <a href="https://github.com/just-the-docs/just-the-docs">Just the Docs</a>, a documentation theme for Jekyll.
32+
This site uses
33+
<a href="https://github.com/just-the-docs/just-the-docs"
34+
>Just the Docs</a
35+
>, a documentation theme for Jekyll.
3836
</footer>
3937

40-
{% if site.search_enabled != false %}
41-
{% include components/search_footer.html %}
42-
{% endif %}
38+
{% if site.search_enabled != false %} {% include
39+
components/search_footer.html %} {% endif %}
4340
</div>
4441

45-
{% if site.mermaid %}
46-
{% include components/mermaid.html %}
47-
{% endif %}
42+
{% if site.mermaid %} {% include components/mermaid.html %} {% endif %}
4843
</body>
4944
</html>

docs/_sass/custom/custom.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ div.site-logo {
2626
.site-footer {
2727
position: static;
2828
width: 100%;
29-
color: #6A686D;
29+
color: #6a686d;
3030
}

0 commit comments

Comments
 (0)