Skip to content

Commit 0a38c29

Browse files
committed
add new include and layout files that are feature flagged
1 parent 86fd80e commit 0a38c29

8 files changed

Lines changed: 246 additions & 0 deletions

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.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{% for tocItem in tocItems %}
2+
3+
<a class="link-with-intro Bump-link--hover no-underline" href="{{ tocItem.fullPath }}">
4+
<h2 class="link-with-intro-title f4">{{ tocItem.title }}<span class="Bump-link-symbol"></span></h2>
5+
</a>
6+
{% if tocItem.intro %}<p class="link-with-intro-intro">{{ tocItem.intro }}</p>{% endif %}
7+
8+
{% endfor %}
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: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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.page.shortTitle and currentProductTree.page.shortTitle != '' %}{% assign productTitle = currentProductTree.page.shortTitle %}{% else %}{% assign productTitle = currentProductTree.page.title %}{% 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.page.shortTitle and childPage.page.shortTitle != '' %}{% assign categoryTitle = childPage.page.shortTitle %}{% else %}{% assign categoryTitle = childPage.page.title %}{% 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">{{ categoryTitle }}</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">{{ categoryTitle }}</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+
<li class="sidebar-maptopic {% if currentPath contains grandchildPage.href %}active {% if currentPath == grandchildPage.href %}is-current-page{% endif %}{% endif %}">
43+
<a href="{{grandchildPage.href}}" class="pl-4 pr-5 py-2">{{ grandchildPage.page.title }} </a>
44+
<ul class="sidebar-articles my-2">
45+
{% for greatgrandchildPage in grandchildPage.childPages %}
46+
<li class="sidebar-article {% if currentPath contains greatgrandchildPage.href %}active {% if currentPath == greatgrandchildPage.href %}is-current-page{% endif %}{% endif %}">
47+
<a href="{{greatgrandchildPage.href}}" class="pl-6 pr-5 py-1{% if forloop.last %} pb-2{% endif %}">{{ greatgrandchildPage.page.title }}</a>
48+
</li>
49+
{% endfor %}
50+
</ul>
51+
</li>
52+
{% endfor %}
53+
</ul>
54+
<!-- some categories have no maptopics, only articles -->
55+
{% elsif childPage.childPages[0].page.documentType == "article" %}
56+
<ul class="sidebar-articles list-style-none">
57+
{% for grandchildPage in childPage.childPages %}
58+
<li class="sidebar-article {% if currentPath contains grandchildPage.href %}active {% if currentPath == grandchildPage.href %}is-current-page{% endif %}{% endif %}">
59+
<a href="{{grandchildPage.href}}" class="pl-4 pr-5 py-1{% if forloop.last %} pb-2{% endif %}">{{ grandchildPage.page.title }}</a>
60+
</li>
61+
{% endfor %}
62+
</ul>
63+
{% endif %}
64+
{% endif %}
65+
</details>
66+
</li>
67+
{% endfor %}
68+
</ul>
69+
</li>
70+
71+
{% 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/generic-toc.html

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<!doctype html>
2+
<html lang="{{currentLanguage}}">
3+
{% include head %}
4+
5+
<body class="d-lg-flex">
6+
{% include sidebar %}
7+
8+
<main class="width-full">
9+
{% include header %}
10+
{% include deprecation-banner %}
11+
<div class="container-xl px-3 px-md-6 my-4 my-lg-4 d-xl-flex">
12+
<article class="markdown-body width-full">
13+
<div class="d-lg-flex flex-justify-between">
14+
<div class="d-block d-lg-none">{% include article-version-switcher %}</div>
15+
<div class="d-flex flex-items-center breadcrumbs-wrapper">
16+
{% include breadcrumbs %}
17+
</div>
18+
<div class="d-none d-lg-block">{% include article-version-switcher %}</div>
19+
</div>
20+
21+
<div class="mt-2 article-grid-container">
22+
23+
<div class="article-grid-head">
24+
<div class="d-flex flex-items-baseline flex-justify-between mt-3">
25+
<h1 class="border-bottom-0">{{ page.title }}</h1>
26+
<div class="d-none d-lg-block ml-2">
27+
<button class="btn-link link-gray js-print tooltipped tooltipped-n" aria-label="Print this article">
28+
{% include printer-icon %}
29+
</button>
30+
</div>
31+
</div>
32+
33+
{% if page.intro %}
34+
<div class="lead-mktg">{{ page.intro }}</div>
35+
{% endif %}
36+
37+
{% if page.product %}
38+
<div class="product-callout border rounded-1 mb-4 p-3 border-purple bg-purple-light">
39+
{{ page.product }}
40+
</div>
41+
{% endif %}
42+
</div>
43+
<div id="article-contents" class="article-grid-body">
44+
{% if featuredLinks.gettingStarted and featuredLinks.popular %}
45+
{% include featured-links %}
46+
{% endif %}
47+
48+
{% include generic-toc %}
49+
</div>
50+
</div>
51+
</article>
52+
</div>
53+
{% include support-section %}
54+
{% include small-footer %}
55+
{% include scroll-button %}
56+
</main>
57+
</body>
58+
</html>

layouts/product-landing.html

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

140140
<div class="container-xl px-3 px-md-6 mt-6">
141+
{% if FEATURE_NEW_SITETREE %}
142+
{% if page.documentType == "category" %}
143+
{% include category-articles-list %}
144+
{% endif %}
145+
{% if page.documentType == "product" %}
146+
{% include product-articles-list %}
147+
{% endif %}
148+
{% endif %}
149+
150+
{% unless FEATURE_NEW_SITETREE %}
141151
{% if currentCategory %}
142152
{% include all-articles-category %}
143153
{% else %}
144154
{% include all-articles-product %}
145155
{% endif %}
156+
{% endunless %}
146157
</div>
147158

148159
{% include support-section %}

0 commit comments

Comments
 (0)