Skip to content

Commit cfd2877

Browse files
authored
Merge pull request #5662 from github/repo-sync
repo sync
2 parents 1a0f3ee + b4f5e04 commit cfd2877

25 files changed

Lines changed: 584 additions & 31 deletions

feature-flags.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
22
"FEATURE_TEST_TRUE": true,
3-
"FEATURE_TEST_FALSE": false
3+
"FEATURE_TEST_FALSE": false,
4+
"FEATURE_NEW_SITETREE": false
45
}

includes/article.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ <h2 id="in-this-article" class="f5 mb-2"><a class="Link--primary" href="#in-this
6868
{% include featured-links %}
6969
{% endif %}
7070
{{ renderedPage }}
71+
72+
{% if tocItems and tocItems.length %}
73+
{% if page.documentType == "category" or page.relativePath == "github/index.md" %}
74+
{% include generic-toc-list %}
75+
{% else %}
76+
{% include generic-toc-items %}
77+
{% endif %}
78+
{% endif %}
7179
</div>
7280
</div>
7381

includes/breadcrumbs.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
{% if FEATURE_NEW_SITETREE %}
2+
<nav class="breadcrumbs f5" aria-label="Breadcrumb">
3+
{% for breadcrumb in breadcrumbs %}
4+
{% if breadcrumb.href == '' %}
5+
<span title="{{ breadcrumb.documentType }}: {{ breadcrumb.title }}">{{ breadcrumb.title }}</span>
6+
{% else %}
7+
<a title="{{ breadcrumb.documentType }}: {{ breadcrumb.title }}" href="{{ breadcrumb.href }}" class="d-inline-block {% if breadcrumb.href == currentPath %}text-gray-light{% endif %}">
8+
{{ breadcrumb.title }}
9+
</a>
10+
{% endif %}
11+
{% endfor %}
12+
</nav>
13+
{% else %}
114
<nav class="breadcrumbs f5" aria-label="Breadcrumb">
215
{% for breadcrumb in breadcrumbs %}
316
{% if breadcrumb[1].href == '' %}
@@ -9,3 +22,4 @@
922
{% endif %}
1023
{% endfor %}
1124
</nav>
25+
{% endif %}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{% for categoryPage in currentProductTree.childPages %}
2+
{% if categoryPage.href == currentPath %}{% assign currentCategory = categoryPage %}{% endif %}
3+
{% endfor %}
4+
5+
{% if currentCategory.page.shortTitle and currentCategory.page.shortTitle != '' %}{% assign currentCategoryTitle = currentCategory.page.shortTitle %}{% else %}{% assign currentCategoryTitle = currentCategory.page.title %}{% endif %}
6+
7+
{% assign maxArticles = 10 %}
8+
9+
<div class="py-6 all-articles-list">
10+
<h2 class="font-mktg mb-4">{{ currentCategoryTitle }} docs</h2>
11+
12+
<div class="d-flex gutter flex-wrap">
13+
{% for childPage in currentCategory.childPages %}
14+
{% unless childPage.page.hidden %}
15+
<div class="col-12 col-lg-4 mb-6 height-full">
16+
<h4 class="mb-3"><a href="{{ childPage.href }}">{{ childPage.page.title }}</a></h4>
17+
<ul class="list-style-none">
18+
{% for grandchildPage in childPage.childPages %}
19+
<li class="mb-3 {% if forloop.index > maxArticles %}d-none{% endif %}">
20+
<a href="{{ grandchildPage.href }}">
21+
{{ grandchildPage.page.title }}
22+
</a>
23+
</li>
24+
{% endfor %}
25+
{% assign numArticles = childPage.childPages | obj_size %}
26+
{% if numArticles > maxArticles %}
27+
<button class="js-all-articles-show-more btn-link Link--secondary">Show {{ numArticles | minus: maxArticles }} more {% octicon "chevron-up" class="v-align-text-bottom" %}</button>
28+
{% endif %}
29+
</ul>
30+
</div>
31+
{% endunless %}
32+
{% endfor %}
33+
</div>
34+
</div>

includes/generic-toc-items.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{% if tocItems %}
2+
3+
{% for tocItem in tocItems %}
4+
5+
{% assign title = tocItem.title %}
6+
{% assign fullPath = tocItem.fullPath %}
7+
{% assign intro = tocItem.intro %}
8+
{% include liquid-tags/link-with-intro %}
9+
10+
{% endfor %}
11+
12+
{% endif %}

includes/generic-toc-list.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{% if tocItems %}
2+
<ul>
3+
{% for tocItem in tocItems %}
4+
5+
{% assign title = tocItem.title %}
6+
{% assign fullPath = tocItem.fullPath %}
7+
{% assign intro = tocItem.intro %}
8+
9+
<li>{% include liquid-tags/link %}
10+
{% if tocItem.childTocItems %}
11+
{% unless page.relativePath == "github/index.md" %}
12+
<ul>
13+
{% for childItem in tocItem.childTocItems %}
14+
{% assign title = childItem.title %}
15+
{% assign fullPath = childItem.fullPath %}
16+
<li>{% include liquid-tags/link %}</li>
17+
{% endfor %}
18+
</ul>
19+
{% endunless %}
20+
{% endif %}
21+
</li>
22+
{% endfor %}
23+
</ul>
24+
{% endif %}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{% assign maxArticles = 10 %}
2+
3+
{% if currentProductTree.page.shortTitle and currentProductTree.page.shortTitle != '' %}{% assign productTitle = currentProductTree.page.shortTitle %}{% else %}{% assign productTitle = currentProductTree.page.title %}{% endif %}
4+
5+
<div class="py-6 all-articles-list">
6+
<h2 class="font-mktg mb-4">All {{ productTitle }} docs</h2>
7+
8+
<div class="d-flex gutter flex-wrap">
9+
{% for childPage in currentProductTree.childPages %}
10+
{% if childPage.page.documentType == "article" %}{% assign standaloneCategory = true %}{% else %}{% assign standaloneCategory = false %}{% endif %}
11+
{% unless standaloneCategory %}
12+
<div class="col-12 col-lg-4 mb-6 height-full">
13+
<h4 class="mb-3"><a href="{{ childPage.href }}">{{ childPage.page.title }}</a></h4>
14+
15+
{% if childPage.childPages and childPage.childPages[0].page.documentType == "mapTopic" %}
16+
<ul class="list-style-none">
17+
{% for grandchildPage in childPage.childPages %}
18+
{% unless grandchildPage.page.hidden %}
19+
{% assign numArticles = childPage.childPages | obj_size %}
20+
<li class="mb-3 {% if forloop.index > maxArticles %}d-none{% endif %}">
21+
<a href="{{ grandchildPage.href }}">
22+
{{ grandchildPage.page.title }}
23+
</a>
24+
</li>
25+
{% if numArticles > maxArticles %}
26+
<button class="js-all-articles-show-more btn-link Link--secondary">Show {{ numArticles | minus: maxArticles }} more {% octicon "chevron-up" class="v-align-text-bottom" %}</button>
27+
{% endif %}
28+
{% endunless %}
29+
{% endfor %}
30+
</ul>
31+
{% else %}
32+
<ul class="list-style-none">
33+
{% assign numArticles = childPage.childPages | obj_size %}
34+
{% for grandchildPage in childPage.childPages %}
35+
<li class="mb-3 {% if forloop.index > maxArticles %}d-none{% endif %}"><a href="{{ grandchildPage.href }}">{{ grandchildPage.page.title }}</a></li>
36+
{% endfor %}
37+
</ul>
38+
{% if numArticles > maxArticles %}
39+
<button class="js-all-articles-show-more btn-link Link--secondary">Show {{ numArticles | minus: maxArticles }} more {% octicon "chevron-up" class="v-align-text-bottom" %}</button>
40+
{% endif %}
41+
{% endif %}
42+
</div>
43+
{% endunless %}
44+
{% endfor %}
45+
</div>
46+
</div>

includes/sidebar-product.html

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
<!--
2+
Styling note:
3+
4+
Categories, Maptopics, and Articles list items get a class of `active` when they correspond to content
5+
hierarchy of the current page. If an item's URL is also the same as the current URL, the item
6+
also gets an `is-current-page` class.
7+
-->
8+
9+
{% include all-products-link %}
10+
11+
{% unless currentProductTree.page.hidden %}
12+
13+
{% if currentProductTree.renderedShortTitle %}{% assign productTitle = currentProductTree.renderedShortTitle %}{% else %}{% assign productTitle = currentProductTree.renderedFullTitle %}{% endif %}
14+
15+
<li title="" class="sidebar-product mb-2">
16+
<a href="{{currentProductTree.href}}" class="pl-4 pr-5 pb-1 f4">{{ productTitle }}</a>
17+
</li>
18+
<li>
19+
<ul class="sidebar-categories list-style-none">
20+
{% for childPage in currentProductTree.childPages %}
21+
{% if childPage.page.documentType == "article" %}{% assign standaloneCategory = true %}{% else %}{% assign standaloneCategory = false %}{% endif %}
22+
<li class="sidebar-category py-1 {% if currentPath contains childPage.href %}active {% if currentPath == childPage.href %}is-current-page {% endif %}{% endif %}{% if standaloneCategory %}standalone-category{% endif %}">
23+
{% if childPage.renderedShortTitle %}{% assign childTitle = childPage.renderedShortTitle %}{% else %}{% assign childTitle = childPage.renderedFullTitle %}{% endif %}
24+
{% if standaloneCategory %}
25+
<a href="{{childPage.href}}" class="pl-4 pr-2 py-2 f6 text-uppercase d-block flex-auto mr-3">{{ childTitle }}</a>
26+
{% else %}
27+
<details class="dropdown-withArrow details details-reset" {% if currentPath contains childPage.href or forloop.index < 4 %}open{% endif %}>
28+
<summary>
29+
<div class="d-flex flex-justify-between">
30+
<a href="{{childPage.href}}" class="pl-4 pr-2 py-2 f6 text-uppercase d-block flex-auto mr-3">{{ childTitle }}</a>
31+
{% if forloop.index < 4 %}
32+
<svg xmlns="http://www.w3.org/2000/svg" class="octicon flex-shrink-0 arrow mr-3" style="margin-top:7px" viewBox="0 0 16 16" width="16" height="16"> <path fill-rule="evenodd" clip-rule="evenodd" d="M12.7803 6.21967C13.0732 6.51256 13.0732 6.98744 12.7803 7.28033L8.53033 11.5303C8.23744 11.8232 7.76256 11.8232 7.46967 11.5303L3.21967 7.28033C2.92678 6.98744 2.92678 6.51256 3.21967 6.21967C3.51256 5.92678 3.98744 5.92678 4.28033 6.21967L8 9.93934L11.7197 6.21967C12.0126 5.92678 12.4874 5.92678 12.7803 6.21967Z"></path></svg>
33+
{% endif %}
34+
</div>
35+
</summary>
36+
{% endif %}
37+
<!-- some categories have maptopics with child articles -->
38+
{% if currentPath contains childPage.href or forloop.index < 4 %}
39+
{% if childPage.childPages[0].page.documentType == "mapTopic" %}
40+
<ul class="sidebar-topics list-style-none position-relative">
41+
{% for grandchildPage in childPage.childPages %}
42+
{% if grandchildPage.renderedShortTitle %}{% assign grandchildTitle = grandchildPage.renderedShortTitle %}{% else %}{% assign grandchildTitle = grandchildPage.renderedFullTitle %}{% endif %}
43+
<li class="sidebar-maptopic {% if currentPath contains grandchildPage.href %}active {% if currentPath == grandchildPage.href %}is-current-page{% endif %}{% endif %}">
44+
<a href="{{grandchildPage.href}}" class="pl-4 pr-5 py-2">{{ grandchildTitle }} </a>
45+
<ul class="sidebar-articles my-2">
46+
{% for greatgrandchildPage in grandchildPage.childPages %}
47+
{% if greatgrandchildPage.renderedShortTitle %}{% assign greatgrandchildTitle = greatgrandchildPage.renderedShortTitle %}{% else %}{% assign greatgrandchildTitle = greatgrandchildPage.renderedFullTitle %}{% endif %}
48+
<li class="sidebar-article {% if currentPath contains greatgrandchildPage.href %}active {% if currentPath == greatgrandchildPage.href %}is-current-page{% endif %}{% endif %}">
49+
<a href="{{greatgrandchildPage.href}}" class="pl-6 pr-5 py-1{% if forloop.last %} pb-2{% endif %}">{{ greatgrandchildTitle }}</a>
50+
</li>
51+
{% endfor %}
52+
</ul>
53+
</li>
54+
{% endfor %}
55+
</ul>
56+
<!-- some categories have no maptopics, only articles -->
57+
{% elsif childPage.childPages[0].page.documentType == "article" %}
58+
<ul class="sidebar-articles list-style-none">
59+
{% for grandchildPage in childPage.childPages %}
60+
{% if grandchildPage.renderedShortTitle %}{% assign grandchildTitle = grandchildPage.renderedShortTitle %}{% else %}{% assign grandchildTitle = grandchildPage.renderedFullTitle %}{% endif %}
61+
<li class="sidebar-article {% if currentPath contains grandchildPage.href %}active {% if currentPath == grandchildPage.href %}is-current-page{% endif %}{% endif %}">
62+
<a href="{{grandchildPage.href}}" class="pl-4 pr-5 py-1{% if forloop.last %} pb-2{% endif %}">{{ grandchildTitle }}</a>
63+
</li>
64+
{% endfor %}
65+
</ul>
66+
{% endif %}
67+
{% endif %}
68+
</details>
69+
</li>
70+
{% endfor %}
71+
</ul>
72+
</li>
73+
74+
{% endunless %}

includes/sidebar.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515
</ul>
1616
{% else %}
1717
<ul class="sidebar-products">
18+
{% if FEATURE_NEW_SITETREE %}
19+
{% include sidebar-product %}
20+
{% else %}
1821
{% include sidebar-specific-product %}
22+
{% endif %}
1923
</ul>
2024
{% endif %}
2125
</nav>

layouts/product-landing.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,22 @@ <h2 class="font-mktg h1 mb-2">Guides</h2>
150150
{% endif %}
151151

152152
<div class="container-xl px-3 px-md-6 mt-6">
153+
{% if FEATURE_NEW_SITETREE %}
154+
{% if page.documentType == "category" %}
155+
{% include category-articles-list %}
156+
{% endif %}
157+
{% if page.documentType == "product" %}
158+
{% include product-articles-list %}
159+
{% endif %}
160+
{% endif %}
161+
162+
{% unless FEATURE_NEW_SITETREE %}
153163
{% if currentCategory %}
154164
{% include all-articles-category %}
155165
{% else %}
156166
{% include all-articles-product %}
157167
{% endif %}
168+
{% endunless %}
158169
</div>
159170

160171
{% include support-section %}

0 commit comments

Comments
 (0)