forked from github/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
homepage-version-switcher.html
29 lines (29 loc) · 1.47 KB
/
homepage-version-switcher.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<!-- Versions picker that only appears in the header on homepage/versioned homepages -->
{% if page.relativePath == 'index.md' %}
<div class="d-md-inline-block">
<div class="border-top border-md-top-0 py-2 py-md-0 d-md-inline-block">
<details class="dropdown-withArrow position-relative details details-reset mr-md-3 close-when-clicked-outside">
<summary class="py-2 text-gray-dark" role="button" aria-label="Toggle versions list">
<div class="d-flex flex-items-center flex-justify-between">
{% if currentVersion == 'homepage' %}
{% data ui.homepage.version_picker %}
{% else %}
{{ allVersions[currentVersion].versionTitle }}
{% endif %}
<svg class="arrow ml-md-1" width="14px" height="8px" viewBox="0 0 14 8" xml:space="preserve" fill="none" stroke="#1B1F23"><path d="M1,1l6.2,6L13,1"></path></svg>
</div>
</summary>
<div id="versions-selector" class="position-md-absolute nav-desktop-langDropdown p-md-4 right-md-n4 top-md-6" style="z-index: 6;">
{% for permalink in page.permalinks %}
{% unless permalink.pageVersion == 'homepage' %}
<a
href="{{ permalink.href }}"
class="d-block py-2 no-underline {% if currentPath == permalink.href %}active{% else %}link-gray-dark{% endif %}"
style="white-space: nowrap"
>{{ allVersions[permalink.pageVersion].versionTitle }}</a>
{% endunless %}
{% endfor %}
</div>
</details>
</div>
{% endif %}