Skip to content

Commit ffbc892

Browse files
committedJun 30, 2022
Autoformat includes/layouts
Let VSCode autoformat these so the indentation is more consistent.
1 parent 8fe3516 commit ffbc892

File tree

6 files changed

+242
-226
lines changed

6 files changed

+242
-226
lines changed
 

‎_includes/footer.html

+50-24
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
<div class="d-flex flex-wrap flex-items-stretch">
66
<div class="col-12 col-sm-6 mb-4 col-border">
77
<div class="height-full p-5">
8-
<img src="{{ "/assets/images/illos/squirrel.svg" | relative_url }}" class="little-illo mb-3" alt="squirrel illustration">
8+
<img src='{{ "/assets/images/illos/squirrel.svg" | relative_url }}' class="little-illo mb-3"
9+
alt="squirrel illustration">
910
<h3 class="h3-mktg mb-3">{{ t.footer.contribute.heading }}</h3>
1011
<p class="mb-3 p-large">{{ t.footer.contribute.description }}</p>
1112
<p>
12-
<a data-proofer-ignore href="https://github.com/{{ site.github.repository_nwo }}/edit/main/{{ page.path }}" class="btn btn-outline">
13+
<a data-proofer-ignore href="https://github.com/{{ site.github.repository_nwo }}/edit/main/{{ page.path }}"
14+
class="btn btn-outline">
1315
{{ t.footer.contribute.button }}
1416
</a>
1517
</p>
@@ -18,52 +20,76 @@ <h3 class="h3-mktg mb-3">{{ t.footer.contribute.heading }}</h3>
1820
<div class="col-12 col-sm-6 mb-4">
1921
<div class="height-full p-5">
2022
<div id="mc_embed_signup">
21-
<form action="//github.us11.list-manage.com/subscribe/post?u=9d7ced8c4bbd6c2f238673f0f&amp;id=b514344ba3" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
23+
<form action="//github.us11.list-manage.com/subscribe/post?u=9d7ced8c4bbd6c2f238673f0f&amp;id=b514344ba3"
24+
method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate"
25+
target="_blank" novalidate>
2226
<div id="mc_embed_signup_scroll">
23-
<img src="{{ "/assets/images/illos/bird.svg" | relative_url }}" class="little-illo mb-3" alt="bird illustration">
24-
<h3 class="h3-mktg mb-3">{{ t.footer.subscribe.heading }}</h3>
25-
<p class="mb-3 p-large">{{ t.footer.subscribe.description }}</p>
27+
<img src='{{ "/assets/images/illos/bird.svg" | relative_url }}' class="little-illo mb-3"
28+
alt="bird illustration">
29+
<h3 class="h3-mktg mb-3">{{ t.footer.subscribe.heading }}</h3>
30+
<p class="mb-3 p-large">{{ t.footer.subscribe.description }}</p>
2631

27-
<div class="mc-field-group col-12">
32+
<div class="mc-field-group col-12">
2833
<label for="mce-EMAIL" class="d-none">{{ t.footer.subscribe.label }}</label>
29-
<input type="email" placeholder="{{ t.footer.subscribe.label }}" name="EMAIL" class="form-input required email d-block col-10 mx-auto py-2 px-3 mb-3" id="mce-EMAIL" autocomplete="home email">
30-
<input type="checkbox" value="1" name="group[9617][1]" id="mce-group[9617]-9617-0" checked="checked" style="display:none">
31-
<input type="submit" value="{{ t.footer.subscribe.button }}" name="subscribe" id="mc-embedded-subscribe" class="btn btn-outline">
32-
</div>
33-
<div id="mce-responses" class="clear">
34+
<input type="email" placeholder="{{ t.footer.subscribe.label }}" name="EMAIL"
35+
class="form-input required email d-block col-10 mx-auto py-2 px-3 mb-3" id="mce-EMAIL"
36+
autocomplete="home email">
37+
<input type="checkbox" value="1" name="group[9617][1]" id="mce-group[9617]-9617-0" checked="checked"
38+
style="display:none">
39+
<input type="submit" value="{{ t.footer.subscribe.button }}" name="subscribe"
40+
id="mc-embedded-subscribe" class="btn btn-outline">
41+
</div>
42+
<div id="mce-responses" class="clear">
3443
<div class="" id="mce-error-response" style="display:none"></div>
3544
<div class="" id="mce-success-response" style="display:none"></div>
45+
</div>
46+
<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text"
47+
name="b_9d7ced8c4bbd6c2f238673f0f_b514344ba3" tabindex="-1" value=""></div>
3648
</div>
37-
<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_9d7ced8c4bbd6c2f238673f0f_b514344ba3" tabindex="-1" value=""></div>
38-
</div>
39-
</form>
49+
</form>
4050
</div>
4151
</div>
4252
</div>
4353
</div>
4454

4555
<div class="border-top text-gray py-5">
46-
<p class="float-md-right"><a class="text-gray-light text-small" href="{{ "/notices/" | relative_url }}">fine print</a></p>
56+
<p class="float-md-right"><a class="text-gray-light text-small" href='{{ "/notices/" | relative_url }}'>fine
57+
print</a></p>
4758

4859
<div>
4960
{% capture code %}
50-
{% assign code_label = t.footer.byline.code_label %}
51-
<svg height="20" class="octicon octicon-code v-align-middle fill-gray mr-1" aria-label="{{ code_label }}" viewBox="0 0 14 16" version="1.1" width="17" role="img"><path d="M9.5 3L8 4.5 11.5 8 8 11.5 9.5 13 14 8 9.5 3zm-5 0L0 8l4.5 5L6 11.5 2.5 8 6 4.5 4.5 3z"></path></svg>
61+
{% assign code_label = t.footer.byline.code_label %}
62+
<svg height="20" class="octicon octicon-code v-align-middle fill-gray mr-1" aria-label="{{ code_label }}"
63+
viewBox="0 0 14 16" version="1.1" width="17" role="img">
64+
<path d="M9.5 3L8 4.5 11.5 8 8 11.5 9.5 13 14 8 9.5 3zm-5 0L0 8l4.5 5L6 11.5 2.5 8 6 4.5 4.5 3z"></path>
65+
</svg>
5266
{% endcapture %}
5367
{% capture love %}
54-
{% assign love_label = t.footer.byline.love_label %}
55-
<svg height="20" class="octicon octicon-heart v-align-middle fill-gray mx-1" aria-label="{{love_label}}" viewBox="0 0 12 16" version="1.1" width="15" role="img"><path d="M11.2 3c-.52-.63-1.25-.95-2.2-1-.97 0-1.69.42-2.2 1-.51.58-.78.92-.8 1-.02-.08-.28-.42-.8-1-.52-.58-1.17-1-2.2-1-.95.05-1.69.38-2.2 1-.52.61-.78 1.28-.8 2 0 .52.09 1.52.67 2.67C1.25 8.82 3.01 10.61 6 13c2.98-2.39 4.77-4.17 5.34-5.33C11.91 6.51 12 5.5 12 5c-.02-.72-.28-1.39-.8-2.02V3z"></path></svg>
68+
{% assign love_label = t.footer.byline.love_label %}
69+
<svg height="20" class="octicon octicon-heart v-align-middle fill-gray mx-1" aria-label="{{love_label}}"
70+
viewBox="0 0 12 16" version="1.1" width="15" role="img">
71+
<path
72+
d="M11.2 3c-.52-.63-1.25-.95-2.2-1-.97 0-1.69.42-2.2 1-.51.58-.78.92-.8 1-.02-.08-.28-.42-.8-1-.52-.58-1.17-1-2.2-1-.95.05-1.69.38-2.2 1-.52.61-.78 1.28-.8 2 0 .52.09 1.52.67 2.67C1.25 8.82 3.01 10.61 6 13c2.98-2.39 4.77-4.17 5.34-5.33C11.91 6.51 12 5.5 12 5c-.02-.72-.28-1.39-.8-2.02V3z">
73+
</path>
74+
</svg>
5675
{% endcapture %}
5776
{% capture github %}
58-
<svg height="20" class="octicon octicon-mark-github v-align-middle fill-gray mx-1" aria-label="GitHub" viewBox="0 0 16 16" version="1.1" width="20" role="img"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"></path></svg>
77+
<svg height="20" class="octicon octicon-mark-github v-align-middle fill-gray mx-1" aria-label="GitHub"
78+
viewBox="0 0 16 16" version="1.1" width="20" role="img">
79+
<path
80+
d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z">
81+
</path>
82+
</svg>
5983
{% endcapture %}
6084
{% capture friends %}
61-
{% assign friends_label = t.footer.byline.friends_label %}
62-
<a href="https://github.com/github/opensource.guide/graphs/contributors" class="text-gray">{{ friends_label }}</a>
85+
{% assign friends_label = t.footer.byline.friends_label %}
86+
<a href="https://github.com/github/opensource.guide/graphs/contributors" class="text-gray">{{ friends_label
87+
}}</a>
6388
{% endcapture %}
6489

6590
{% assign byline = t.footer.byline.format %}
66-
{{ byline | replace: "[code]", code | replace: "[love]", love | replace: "[github]", github | replace: "[friends]", friends }}
91+
{{ byline | replace: "[code]", code | replace: "[love]", love | replace: "[github]", github | replace:
92+
"[friends]", friends }}
6793
</div>
6894
</div>
6995
</div>

‎_includes/head.html

+13-13
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44
<meta name="google-site-verification" content="c1kuD-K2HIVF635lypcsWPoD4kilo5-jA_wBFyT4uMY" />
55
<link rel="icon" type="image/x-icon" href="https://github.githubassets.com/favicon.ico">
66
<link href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i" rel="stylesheet">
7-
<link href="{{ "/assets/css/index.css" | relative_url }}" rel="stylesheet">
7+
<link href='{{ "/assets/css/index.css" | relative_url }}' rel="stylesheet">
88
{% seo %}
99
{% if page.lang and page.untranslated != true and site.data.locales.size > 1 %}
10-
{% assign locales = site.data.locales | sort %}
11-
{% for locale in locales %}
12-
{% assign lang = locale[0] %}
13-
{% assign page_lang_slash = page.lang | append: '/' | prepend: '/' %}
14-
{% assign default_url = page.url | replace: page_lang_slash, '/' %}
15-
{% if lang == "en" %}
16-
<link rel="alternate" hreflang="en" href="{{ site.url }}{{ default_url }}" />
17-
<link rel="alternate" hreflang="x-default" href="{{ site.url }}{{ default_url }}" />
18-
{% else %}
19-
<link rel="alternate" hreflang="{{ lang }}" href="{{ site.url }}/{{ lang }}{{ default_url }}" />
20-
{% endif %}
21-
{% endfor %}
10+
{% assign locales = site.data.locales | sort %}
11+
{% for locale in locales %}
12+
{% assign lang = locale[0] %}
13+
{% assign page_lang_slash = page.lang | append: '/' | prepend: '/' %}
14+
{% assign default_url = page.url | replace: page_lang_slash, '/' %}
15+
{% if lang == "en" %}
16+
<link rel="alternate" hreflang="en" href="{{ site.url }}{{ default_url }}" />
17+
<link rel="alternate" hreflang="x-default" href="{{ site.url }}{{ default_url }}" />
18+
{% else %}
19+
<link rel="alternate" hreflang="{{ lang }}" href="{{ site.url }}/{{ lang }}{{ default_url }}" />
20+
{% endif %}
21+
{% endfor %}
2222
{% endif %}
2323
</head>

‎_includes/jekyll-toc.html

+146-166
Original file line numberDiff line numberDiff line change
@@ -1,186 +1,166 @@
11
{% capture tocWorkspace %}
2-
{% comment %}
3-
Copyright (c) 2017 Vladimir "allejo" Jimenez
4-
5-
Permission is hereby granted, free of charge, to any person
6-
obtaining a copy of this software and associated documentation
7-
files (the "Software"), to deal in the Software without
8-
restriction, including without limitation the rights to use,
9-
copy, modify, merge, publish, distribute, sublicense, and/or sell
10-
copies of the Software, and to permit persons to whom the
11-
Software is furnished to do so, subject to the following
12-
conditions:
13-
14-
The above copyright notice and this permission notice shall be
15-
included in all copies or substantial portions of the Software.
16-
17-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19-
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21-
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22-
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23-
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24-
OTHER DEALINGS IN THE SOFTWARE.
25-
{% endcomment %}
26-
{% comment %}
27-
Version 1.2.0
28-
https://github.com/allejo/jekyll-toc
29-
30-
"...like all things liquid - where there's a will, and ~36 hours to spare, there's usually a/some way" ~jaybe
31-
32-
Usage:
33-
{% include jekyll-toc.html html=content sanitize=true class="inline_toc" id="my_toc" h_min=2 h_max=3 %}
34-
35-
Parameters:
36-
* html (string) - the HTML of compiled markdown generated by kramdown in Jekyll
37-
38-
Optional Parameters:
39-
* sanitize (bool) : false - when set to true, the headers will be stripped of any HTML in the TOC
40-
* class (string) : '' - a CSS class assigned to the TOC
41-
* id (string) : '' - an ID to assigned to the TOC
42-
* h_min (int) : 1 - the minimum TOC header level to use; any header lower than this value will be ignored
43-
* h_max (int) : 6 - the maximum TOC header level to use; any header greater than this value will be ignored
44-
* ordered (bool) : false - when set to true, an ordered list will be outputted instead of an unordered list
45-
* item_class (string) : '' - add custom class(es) for each list item; has support for '%level%' placeholder, which is the current heading level
46-
* submenu_class (string) : '' - add custom class(es) for each child group of headings; has support for '%level%' placeholder which is the current "submenu" heading level
47-
* base_url (string) : '' - add a base url to the TOC links for when your TOC is on another page than the actual content
48-
* anchor_class (string) : '' - add custom class(es) for each anchor element
49-
* skip_no_ids (bool) : false - skip headers that do not have an `id` attribute
50-
51-
Output:
52-
An ordered or unordered list representing the table of contents of a markdown block. This snippet will only
53-
generate the table of contents and will NOT output the markdown given to it
54-
{% endcomment %}
55-
56-
{% capture newline %}
57-
{% endcapture %}
58-
{% assign newline = newline | rstrip %} <!-- Remove the extra spacing but preserve the newline -->
59-
60-
{% capture deprecation_warnings %}{% endcapture %}
61-
62-
{% if include.baseurl %}
63-
{% capture deprecation_warnings %}{{ deprecation_warnings }}<!-- jekyll-toc :: "baseurl" has been deprecated, use "base_url" instead -->{{ newline }}{% endcapture %}
2+
{% comment %}
3+
Copyright (c) 2017 Vladimir "allejo" Jimenez
4+
5+
Permission is hereby granted, free of charge, to any person
6+
obtaining a copy of this software and associated documentation
7+
files (the "Software"), to deal in the Software without
8+
restriction, including without limitation the rights to use,
9+
copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the
11+
Software is furnished to do so, subject to the following
12+
conditions:
13+
14+
The above copyright notice and this permission notice shall be
15+
included in all copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
19+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24+
OTHER DEALINGS IN THE SOFTWARE.
25+
{% endcomment %}
26+
{% comment %}
27+
Version 1.2.0
28+
https://github.com/allejo/jekyll-toc
29+
30+
"...like all things liquid - where there's a will, and ~36 hours to spare, there's usually a/some way" ~jaybe
31+
32+
Usage:
33+
{% include jekyll-toc.html html=content sanitize=true class="inline_toc" id="my_toc" h_min=2 h_max=3 %}
34+
35+
Parameters:
36+
* html (string) - the HTML of compiled markdown generated by kramdown in Jekyll
37+
38+
Optional Parameters:
39+
* sanitize (bool) : false - when set to true, the headers will be stripped of any HTML in the TOC
40+
* class (string) : '' - a CSS class assigned to the TOC
41+
* id (string) : '' - an ID to assigned to the TOC
42+
* h_min (int) : 1 - the minimum TOC header level to use; any header lower than this value will be ignored
43+
* h_max (int) : 6 - the maximum TOC header level to use; any header greater than this value will be ignored
44+
* ordered (bool) : false - when set to true, an ordered list will be outputted instead of an unordered list
45+
* item_class (string) : '' - add custom class(es) for each list item; has support for '%level%' placeholder, which is
46+
the current heading level
47+
* submenu_class (string) : '' - add custom class(es) for each child group of headings; has support for '%level%'
48+
placeholder which is the current "submenu" heading level
49+
* base_url (string) : '' - add a base url to the TOC links for when your TOC is on another page than the actual content
50+
* anchor_class (string) : '' - add custom class(es) for each anchor element
51+
* skip_no_ids (bool) : false - skip headers that do not have an `id` attribute
52+
53+
Output:
54+
An ordered or unordered list representing the table of contents of a markdown block. This snippet will only
55+
generate the table of contents and will NOT output the markdown given to it
56+
{% endcomment %}
57+
58+
{% capture newline %}
59+
{% endcapture %}
60+
{% assign newline = newline | rstrip %}
61+
<!-- Remove the extra spacing but preserve the newline -->
62+
63+
{% capture deprecation_warnings %}{% endcapture %}
64+
65+
{% if include.baseurl %}
66+
{% capture deprecation_warnings %}{{ deprecation_warnings }}
67+
<!-- jekyll-toc :: "baseurl" has been deprecated, use "base_url" instead -->{{ newline }}{% endcapture %}
68+
{% endif %}
69+
70+
{% if include.skipNoIDs %}
71+
{% capture deprecation_warnings %}{{ deprecation_warnings }}
72+
<!-- jekyll-toc :: "skipNoIDs" has been deprecated, use "skip_no_ids" instead -->{{ newline }}{% endcapture %}
73+
{% endif %}
74+
75+
{% capture jekyll_toc %}{% endcapture %}
76+
{% assign orderedList = include.ordered | default: false %}
77+
{% assign baseURL = include.base_url | default: include.baseurl | default: '' %}
78+
{% assign skipNoIDs = include.skip_no_ids | default: include.skipNoIDs | default: false %}
79+
{% assign minHeader = include.h_min | default: 1 %}
80+
{% assign maxHeader = include.h_max | default: 6 %}
81+
{% assign nodes = include.html | strip | split: '<h' %} {% assign firstHeader=true %} {% assign currLevel=0 %} {% assign
82+
lastLevel=0 %} {% capture listModifier %}{% if orderedList %}ol{% else %}ul{% endif %}{% endcapture %} {% for node
83+
in nodes %} {% if node=="" %} {% continue %} {% endif %} {% if forloop.last==true %} {% continue %} {% endif %} {%
84+
assign currLevel=node | replace: '"' , '' | slice: 0, 1 | times: 1 %} {% if currLevel < minHeader or currLevel>
85+
maxHeader %}
86+
{% continue %}
6487
{% endif %}
6588

66-
{% if include.skipNoIDs %}
67-
{% capture deprecation_warnings %}{{ deprecation_warnings }}<!-- jekyll-toc :: "skipNoIDs" has been deprecated, use "skip_no_ids" instead -->{{ newline }}{% endcapture %}
89+
{% assign _workspace = node | split: '</h' %} {% assign _idWorkspace=_workspace[0] | split: 'id="' %} {% assign
90+
_idWorkspace=_idWorkspace[1] | split: '"' %} {% assign htmlID=_idWorkspace[0] %} {% assign
91+
_classWorkspace=_workspace[0] | split: 'class="' %} {% assign _classWorkspace=_classWorkspace[1] | split: '"' %} {%
92+
assign htmlClass=_classWorkspace[0] %} {% if htmlClass contains "no_toc" %} {% continue %} {% endif %} {% if
93+
firstHeader %} {% assign minHeader=currLevel %} {% endif %} {% capture _hAttrToStrip %}{{ _workspace[0] | split: '>'
94+
| first }}>{% endcapture %}
95+
{% assign header = _workspace[0] | replace: _hAttrToStrip, '' %}
96+
97+
{% if include.item_class and include.item_class != blank %}
98+
{% capture listItemClass %} class="{{ include.item_class | replace: '%level%', currLevel | split: '.' | join: ' ' }}"{%
99+
endcapture %}
100+
{% endif %}
101+
102+
{% if include.submenu_class and include.submenu_class != blank %}
103+
{% assign subMenuLevel = currLevel | minus: 1 %}
104+
{% capture subMenuClass %} class="{{ include.submenu_class | replace: '%level%', subMenuLevel | split: '.' | join: ' '
105+
}}"{% endcapture %}
106+
{% endif %}
107+
108+
{% capture anchorBody %}{% if include.sanitize %}{{ header | strip_html }}{% else %}{{ header }}{% endif %}{% endcapture
109+
%}
110+
111+
{% if htmlID %}
112+
{% capture anchorAttributes %} href="{% if baseURL %}{{ baseURL }}{% endif %}#{{ htmlID }}"{% endcapture %}
113+
114+
{% if include.anchor_class %}
115+
{% capture anchorAttributes %}{{ anchorAttributes }} class="{{ include.anchor_class | split: '.' | join: ' ' }}"{%
116+
endcapture %}
117+
{% endif %}
118+
119+
{% capture listItem %}<a{{ anchorAttributes }}>{{ anchorBody }}</a>{% endcapture %}
120+
{% elsif skipNoIDs == true %}
121+
{% continue %}
122+
{% else %}
123+
{% capture listItem %}{{ anchorBody }}{% endcapture %}
68124
{% endif %}
69125

70-
{% capture jekyll_toc %}{% endcapture %}
71-
{% assign orderedList = include.ordered | default: false %}
72-
{% assign baseURL = include.base_url | default: include.baseurl | default: '' %}
73-
{% assign skipNoIDs = include.skip_no_ids | default: include.skipNoIDs | default: false %}
74-
{% assign minHeader = include.h_min | default: 1 %}
75-
{% assign maxHeader = include.h_max | default: 6 %}
76-
{% assign nodes = include.html | strip | split: '<h' %}
77-
78-
{% assign firstHeader = true %}
79-
{% assign currLevel = 0 %}
80-
{% assign lastLevel = 0 %}
81-
82-
{% capture listModifier %}{% if orderedList %}ol{% else %}ul{% endif %}{% endcapture %}
83-
84-
{% for node in nodes %}
85-
{% if node == "" %}
86-
{% continue %}
87-
{% endif %}
88-
89-
{% if forloop.last == true %}
90-
{% continue %}
91-
{% endif %}
92-
93-
{% assign currLevel = node | replace: '"', '' | slice: 0, 1 | times: 1 %}
94-
95-
{% if currLevel < minHeader or currLevel > maxHeader %}
96-
{% continue %}
97-
{% endif %}
98-
99-
{% assign _workspace = node | split: '</h' %}
100-
101-
{% assign _idWorkspace = _workspace[0] | split: 'id="' %}
102-
{% assign _idWorkspace = _idWorkspace[1] | split: '"' %}
103-
{% assign htmlID = _idWorkspace[0] %}
104-
105-
{% assign _classWorkspace = _workspace[0] | split: 'class="' %}
106-
{% assign _classWorkspace = _classWorkspace[1] | split: '"' %}
107-
{% assign htmlClass = _classWorkspace[0] %}
108-
109-
{% if htmlClass contains "no_toc" %}
110-
{% continue %}
111-
{% endif %}
112-
113-
{% if firstHeader %}
114-
{% assign minHeader = currLevel %}
115-
{% endif %}
116-
117-
{% capture _hAttrToStrip %}{{ _workspace[0] | split: '>' | first }}>{% endcapture %}
118-
{% assign header = _workspace[0] | replace: _hAttrToStrip, '' %}
119-
120-
{% if include.item_class and include.item_class != blank %}
121-
{% capture listItemClass %} class="{{ include.item_class | replace: '%level%', currLevel | split: '.' | join: ' ' }}"{% endcapture %}
122-
{% endif %}
123-
124-
{% if include.submenu_class and include.submenu_class != blank %}
125-
{% assign subMenuLevel = currLevel | minus: 1 %}
126-
{% capture subMenuClass %} class="{{ include.submenu_class | replace: '%level%', subMenuLevel | split: '.' | join: ' ' }}"{% endcapture %}
127-
{% endif %}
128-
129-
{% capture anchorBody %}{% if include.sanitize %}{{ header | strip_html }}{% else %}{{ header }}{% endif %}{% endcapture %}
130-
131-
{% if htmlID %}
132-
{% capture anchorAttributes %} href="{% if baseURL %}{{ baseURL }}{% endif %}#{{ htmlID }}"{% endcapture %}
133-
134-
{% if include.anchor_class %}
135-
{% capture anchorAttributes %}{{ anchorAttributes }} class="{{ include.anchor_class | split: '.' | join: ' ' }}"{% endcapture %}
136-
{% endif %}
137-
138-
{% capture listItem %}<a{{ anchorAttributes }}>{{ anchorBody }}</a>{% endcapture %}
139-
{% elsif skipNoIDs == true %}
140-
{% continue %}
141-
{% else %}
142-
{% capture listItem %}{{ anchorBody }}{% endcapture %}
143-
{% endif %}
144-
145-
{% if currLevel > lastLevel %}
146-
{% capture jekyll_toc %}{{ jekyll_toc }}<{{ listModifier }}{{ subMenuClass }}>{% endcapture %}
147-
{% elsif currLevel < lastLevel %}
148-
{% assign repeatCount = lastLevel | minus: currLevel %}
149-
150-
{% for i in (1..repeatCount) %}
151-
{% capture jekyll_toc %}{{ jekyll_toc }}</li></{{ listModifier }}>{% endcapture %}
152-
{% endfor %}
126+
{% if currLevel > lastLevel %}
127+
{% capture jekyll_toc %}{{ jekyll_toc }}<{{ listModifier }}{{ subMenuClass }}>{% endcapture %}
128+
{% elsif currLevel < lastLevel %} {% assign repeatCount=lastLevel | minus: currLevel %} {% for i in
129+
(1..repeatCount) %} {% capture jekyll_toc %}{{ jekyll_toc }}</li>
130+
</{{ listModifier }}>{% endcapture %}
131+
{% endfor %}
153132

154-
{% capture jekyll_toc %}{{ jekyll_toc }}</li>{% endcapture %}
155-
{% else %}
156-
{% capture jekyll_toc %}{{ jekyll_toc }}</li>{% endcapture %}
157-
{% endif %}
133+
{% capture jekyll_toc %}{{ jekyll_toc }}</li>{% endcapture %}
134+
{% else %}
135+
{% capture jekyll_toc %}{{ jekyll_toc }}</li>{% endcapture %}
136+
{% endif %}
158137

159-
{% capture jekyll_toc %}{{ jekyll_toc }}<li{{ listItemClass }}>{{ listItem }}{% endcapture %}
138+
{% capture jekyll_toc %}{{ jekyll_toc }}<li{{ listItemClass }}>{{ listItem }}{% endcapture %}
160139

161140
{% assign lastLevel = currLevel %}
162141
{% assign firstHeader = false %}
163-
{% endfor %}
142+
{% endfor %}
164143

165-
{% assign repeatCount = minHeader | minus: 1 %}
166-
{% assign repeatCount = lastLevel | minus: repeatCount %}
167-
{% for i in (1..repeatCount) %}
168-
{% capture jekyll_toc %}{{ jekyll_toc }}</li></{{ listModifier }}>{% endcapture %}
169-
{% endfor %}
144+
{% assign repeatCount = minHeader | minus: 1 %}
145+
{% assign repeatCount = lastLevel | minus: repeatCount %}
146+
{% for i in (1..repeatCount) %}
147+
{% capture jekyll_toc %}{{ jekyll_toc }}</li>
148+
</{{ listModifier }}>{% endcapture %}
149+
{% endfor %}
170150

171-
{% if jekyll_toc != '' %}
151+
{% if jekyll_toc != '' %}
172152
{% assign rootAttributes = '' %}
173153
{% if include.class and include.class != blank %}
174-
{% capture rootAttributes %} class="{{ include.class | split: '.' | join: ' ' }}"{% endcapture %}
154+
{% capture rootAttributes %} class="{{ include.class | split: '.' | join: ' ' }}"{% endcapture %}
175155
{% endif %}
176156

177157
{% if include.id and include.id != blank %}
178-
{% capture rootAttributes %}{{ rootAttributes }} id="{{ include.id }}"{% endcapture %}
158+
{% capture rootAttributes %}{{ rootAttributes }} id="{{ include.id }}"{% endcapture %}
179159
{% endif %}
180160

181161
{% if rootAttributes %}
182-
{% assign nodes = jekyll_toc | split: '>' %}
183-
{% capture jekyll_toc %}<{{ listModifier }}{{ rootAttributes }}>{{ nodes | shift | join: '>' }}>{% endcapture %}
184-
{% endif %}
185-
{% endif %}
186-
{% endcapture %}{% assign tocWorkspace = '' %}{{ deprecation_warnings }}{{ jekyll_toc -}}
162+
{% assign nodes = jekyll_toc | split: '>' %}
163+
{% capture jekyll_toc %}<{{ listModifier }}{{ rootAttributes }}>{{ nodes | shift | join: '>' }}>{% endcapture %}
164+
{% endif %}
165+
{% endif %}
166+
{% endcapture %}{% assign tocWorkspace = '' %}{{ deprecation_warnings }}{{ jekyll_toc -}}

‎_includes/nav.html

+9-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
<nav class="main-nav">
33
<div class="container-lg mx-auto clearfix">
44
<div class="float-sm-right">
5-
<ul class="main-links d-flex flex-wrap flex-items-stretch flex-justify-center border-left border-bottom border-sm-0 list-style-none">
5+
<ul
6+
class="main-links d-flex flex-wrap flex-items-stretch flex-justify-center border-left border-bottom border-sm-0 list-style-none">
67
<li class="d-inline-block border-right">
78
<a class="d-block p-4" href="https://github.com/github/opensource.guide#readme">
89
{{ t.nav.about }}
@@ -19,13 +20,13 @@
1920
<select id="language" class="form-select">
2021
{% assign locales = site.data.locales | sort %}
2122
{% for locale in locales %}
22-
{% assign lang = locale[0] %}
23-
{% assign locale_name = locale[1][lang].locale_name %}
24-
{% if page.lang == lang %}
25-
<option value="{{ lang }}" selected="selected">{{ locale_name }}</option>
26-
{% else %}
27-
<option value="{{ lang }}">{{ locale_name }}</option>
28-
{% endif %}
23+
{% assign lang = locale[0] %}
24+
{% assign locale_name = locale[1][lang].locale_name %}
25+
{% if page.lang == lang %}
26+
<option value="{{ lang }}" selected="selected">{{ locale_name }}</option>
27+
{% else %}
28+
<option value="{{ lang }}">{{ locale_name }}</option>
29+
{% endif %}
2930
{% endfor %}
3031
</select>
3132
</div>

‎_layouts/article.html

+10-4
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,14 @@ <h1 class="h0-mktg lh-condensed text-center mb-3">{{ page.title }}</h1>
1212
<nav class="toc mb-4 mb-md-6">
1313
<div class="Box col-sm-8 col-md-4 col-lg-3 mx-auto">
1414
<a class="toc-trigger d-block text-center p-3">
15-
<span class="text-black">{{ t.article.table_of_contents }}</span><svg height="18" class="octicon octicon-triangle-down ml-2 fill-blue v-align-middle icon-flip" viewBox="0 0 12 16" version="1.1" width="13" role="img"><path fill-rule="evenodd" d="M0 5l6 6 6-6z"></path></svg>
15+
<span class="text-black">{{ t.article.table_of_contents }}</span><svg height="18"
16+
class="octicon octicon-triangle-down ml-2 fill-blue v-align-middle icon-flip" viewBox="0 0 12 16"
17+
version="1.1" width="13" role="img">
18+
<path fill-rule="evenodd" d="M0 5l6 6 6-6z"></path>
19+
</svg>
1620
</a>
17-
{% include jekyll-toc.html html=content h_max=2 ordered=true class="toc-list list-style-none" item_class="border-top" anchor_class="d-block py-3 px-3" %}
21+
{% include jekyll-toc.html html=content h_max=2 ordered=true class="toc-list list-style-none"
22+
item_class="border-top" anchor_class="d-block py-3 px-3" %}
1823
</div>
1924
</nav>
2025
<div class="col-sm-10 mx-auto lh-none cover-img">
@@ -44,7 +49,8 @@ <h2 class="h2-mktg">{{ t.article.related_guides }}</h2>
4449
<a href="{{ article.url | relative_url }}" class="guide-cover {{ article.class }} Box height-full d-block">
4550

4651
<div class="lh-none guide-cover-img text-center pt-4">
47-
<img src="{{ site.baseurl }}/assets/images/illos/{{ article.class }}.svg" class="" alt="{{ article.title }} illustration">
52+
<img src="{{ site.baseurl }}/assets/images/illos/{{ article.class }}.svg" class=""
53+
alt="{{ article.title }} illustration">
4854
</div>
4955

5056
<div class="flex-self-end p-4 text-center p-lg-5">
@@ -63,4 +69,4 @@ <h3 class="h3-mktg text-bold lh-condensed mb-2 text-black">
6369
</div>
6470
{% endif %}
6571

66-
{% include footer.html %}
72+
{% include footer.html %}

‎_layouts/default.html

+14-11
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
<!DOCTYPE html>
22
<html lang="{{ page.lang }}">
3-
{% include head.html %}
4-
<body>
5-
<main>
6-
<div id="content">
7-
{{ content }}
8-
</div>
9-
</main>
3+
{% include head.html %}
4+
5+
<body>
6+
<main>
7+
<div id="content">
8+
{{ content }}
9+
</div>
10+
</main>
11+
12+
<script src='{{ "/assets/js/index.js" | relative_url }}'></script>
13+
<script type="text/javascript" src="https://s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js"></script>
14+
<script
15+
type="text/javascript">(function ($) { window.fnames = new Array(); window.ftypes = new Array(); fnames[0] = 'EMAIL'; ftypes[0] = 'email'; fnames[1] = 'FNAME'; ftypes[1] = 'text'; fnames[2] = 'LNAME'; ftypes[2] = 'text'; }(jQuery)); var $mcj = jQuery.noConflict(true);</script>
16+
</body>
1017

11-
<script src="{{ "/assets/js/index.js" | relative_url }}"></script>
12-
<script type="text/javascript" src="https://s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js"></script>
13-
<script type="text/javascript">(function($) {window.fnames = new Array(); window.ftypes = new Array();fnames[0]='EMAIL';ftypes[0]='email';fnames[1]='FNAME';ftypes[1]='text';fnames[2]='LNAME';ftypes[2]='text';}(jQuery));var $mcj = jQuery.noConflict(true);</script>
14-
</body>
1518
</html>

0 commit comments

Comments
 (0)
Please sign in to comment.