Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7578ddd

Browse files
committed
show lang-navigation on versioned docs but only point up-to-date version
(so it doesn't get cluttered with python symbols)
1 parent e3b16de commit 7578ddd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

_includes/lang-navigation.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
{%- if page.permalink contains "javascript" -%}
77
{%- assign page_type = page.permalink | remove_first: "javascript" -%}
88
{%- endif -%}
9+
{%- if page.permalink contains "version" -%}
10+
{%- capture version -%}/version{{page.version}}{%- endcapture -%}
11+
{%- assign page_type = page_type | remove_first: version | remove_first: page.version -%}
12+
{%- endif -%}
913

1014
{%- if page.language == "python" -%}
1115
{%- assign pyclass = "current" -%}
@@ -43,7 +47,7 @@
4347
</a>
4448
</li>
4549
{%- endif -%}
46-
{%- if page.permalink contains {{page_type}} and page.language == "python" -%}
50+
{%- if page.permalink contains {{page_type}} and page.language == "python" and page.current -%}
4751
<li class="lang-nav--item">
4852
<a class="lang_nav_button {{pyclass}}" href="/python{{page_type}}">
4953
<div><img src="https://plot.ly/gh-pages/documentation/static/images/python-small.png" alt="python" class="lang_nav_thum"></div>

0 commit comments

Comments
 (0)