Keep guidelines menu in sync with ToC (#2856)
This commit is contained in:
Родитель
4b1ca0f3e1
Коммит
a7d20a1186
|
@ -11,30 +11,10 @@ topnav_dropdowns:
|
|||
- title: Topnav Dropdowns
|
||||
folders:
|
||||
- title: Guidelines
|
||||
folderitems:
|
||||
- title: General
|
||||
url: /general_introduction.html
|
||||
- title: Android (Draft)
|
||||
url: /android_design.html
|
||||
- title: C (Draft)
|
||||
url: /clang_design.html
|
||||
- title: C++ (Draft)
|
||||
url: /cpp_introduction.html
|
||||
- title: C#.NET
|
||||
url: /dotnet_introduction.html
|
||||
- title: Go (Draft)
|
||||
url: /golang_introduction.html
|
||||
- title: iOS (Draft)
|
||||
url: /ios_introduction.html
|
||||
- title: Java
|
||||
url: /java_introduction.html
|
||||
- title: Python
|
||||
url: /python_design.html
|
||||
- title: TypeScript
|
||||
url: /typescript_introduction.html
|
||||
guidelines: true
|
||||
- title: API References
|
||||
folderitems:
|
||||
- title: C#.NET
|
||||
- title: .NET
|
||||
external_url: https://aka.ms/net-docs
|
||||
- title: Java
|
||||
external_url: https://aka.ms/java-docs
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
|
||||
{% assign topnav = site.data[page.topnav] %}
|
||||
{% assign topnav_dropdowns = site.data[page.topnav].topnav_dropdowns %}
|
||||
{% assign topnav_guidelines = site.data.sidebars.general_sidebar.entries[0] %}
|
||||
|
||||
{% for entry in topnav.topnav %}
|
||||
{% for item in entry.items %}
|
||||
|
@ -39,6 +40,11 @@
|
|||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ folder.title }}<b class="caret"></b></a>
|
||||
<ul class="dropdown-menu">
|
||||
{% if folder.guidelines %}
|
||||
{% for folderitem in topnav_guidelines.folders %}
|
||||
<li><a href="{{folderitem.folderitems[0].url}}" rel="noopener">{{folderitem.title}}</a></li>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{% for folderitem in folder.folderitems %}
|
||||
{% if folderitem.external_url %}
|
||||
<li><a href="{{folderitem.external_url}}" rel="noopener">{{folderitem.title}}</a></li>
|
||||
|
@ -48,6 +54,7 @@
|
|||
<li><a href="{{folderitem.url | relative_url }}">{{folderitem.title}}</a></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</ul>
|
||||
</li>
|
||||
{% endfor %}
|
||||
|
|
Загрузка…
Ссылка в новой задаче