Skip to content

Commit 7ac8632

Browse files
authored
Merge pull request #649 from gaurav-nelson/breadcrumbs+ai
feat: Add breadcrumb navigation, page actions toolbar, and copy page option
2 parents 9960f29 + a7406e0 commit 7ac8632

File tree

21 files changed

+790
-107
lines changed

21 files changed

+790
-107
lines changed

layouts/_default/baseof.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
</div>
1111
<script src="{{ "js/codeblock.js" | relURL }}"></script>
1212
<script src="{{ "js/mobile-nav.js" | relURL }}"></script>
13+
<script src="{{ "js/page-actions.js" | relURL }}"></script>
1314
</body>
1415
<!-- Uncomment when you have sorted out the feedback partials option
1516
<body>

layouts/blog/list.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@
1010

1111
<main class="pf-c-page__main" id="maincontent">
1212
<section class="pf-c-page__main-section">
13-
<!-- Sidebar toggle for mobile -->
14-
<div class="sidebar-toggle-container">
15-
{{ partial "sidebar-toggle.html" . }}
16-
</div>
13+
{{ partial "page-toolbar.html" . }}
1714
<div class="pf-l-grid__item pf-m-9-col">
1815
<div class="pf-u-text-align-center">
1916
<div class="pf-c-content" style="--pf-c-content--FontSize: 1rem;">

layouts/blog/single.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@
1818
</div>
1919
</div>
2020
</div>
21-
<main class="pf-c-page__main" tabindex="0" data-bs-spy="scroll" data-bs-target="#TableOfContents" data-bs-offset="50">
21+
<main class="pf-c-page__main" tabindex="0">
2222
<section class="pf-c-page__main-section">
23+
{{ partial "toc-mobile.html" . }}
2324
<div class="pf-u-display-flex">
25+
{{ partial "toc.html" . }}
2426
<div class="pf-c-content">
2527
<h1>
2628
{{- .Title -}}
@@ -45,7 +47,6 @@ <h1>
4547
{{ .Content }}
4648
</div>
4749
</div>
48-
{{ partial "toc.html" . }}
4950
</div>
5051
</section>
5152
{{ partial "footer.html" . }}

layouts/ci/single.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@
1010
</div>
1111
<main class="pf-c-page__main">
1212
<section class="pf-c-page__main-section">
13-
<!-- Sidebar toggle for mobile -->
14-
<div class="sidebar-toggle-container">
15-
{{ partial "sidebar-toggle.html" . }}
16-
</div>
13+
{{ partial "page-toolbar.html" . }}
1714
<div class="pf-u-display-flex">
1815
<div class="pf-c-content">
1916
<h1>{{- .Title -}}</h1>

layouts/contribute/list.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77

88
<main class="pf-c-page__main">
99
<section class="pf-c-page__main-section">
10-
<!-- Sidebar toggle for mobile -->
11-
<div class="sidebar-toggle-container">
12-
{{ partial "sidebar-toggle.html" . }}
13-
</div>
10+
{{ partial "page-toolbar.html" . }}
1411
<div class="pf-l-grid__item pf-m-9-col">
1512
<div class="pf-u-text-align-center">
1613
<div class="pf-c-content" style="--pf-c-content--FontSize: 1rem;">

layouts/contribute/single.html

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,15 @@
55
{{ partial "menu-contribute.html" . }}
66
</div>
77
</div>
8-
<main class="pf-c-page__main" tabindex="0" data-bs-spy="scroll" data-bs-target="#TableOfContents" data-bs-offset="50">
8+
<main class="pf-c-page__main" tabindex="0">
99
<section class="pf-c-page__main-section pf-m-fill">
10-
<!-- Sidebar toggle for mobile -->
11-
<div class="sidebar-toggle-container">
12-
{{ partial "sidebar-toggle.html" . }}
13-
</div>
10+
{{ partial "toc-mobile.html" . }}
11+
{{ partial "page-toolbar.html" . }}
1412
<div class="pf-u-display-flex">
13+
{{ partial "toc.html" . }}
1514
<div class="pf-c-content">
1615
{{ .Content }}
1716
</div>
18-
{{ partial "toc.html" . }}
1917
</div>
2018
</section>
2119
{{ partial "footer.html" . }}

layouts/learn/list.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77

88
<main class="pf-c-page__main">
99
<section class="pf-c-page__main-section">
10-
<!-- Sidebar toggle for mobile -->
11-
<div class="sidebar-toggle-container">
12-
{{ partial "sidebar-toggle.html" . }}
13-
</div>
10+
{{ partial "page-toolbar.html" . }}
1411
<div class="pf-l-grid__item pf-m-9-col">
1512
<div class="pf-u-text-align-center">
1613
<div class="pf-c-content" style="--pf-c-content--FontSize: 1rem;">

layouts/learn/single.html

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55
{{ partial "menu-learn.html" . }}
66
</div>
77
</div>
8-
<main class="pf-c-page__main" tabindex="0" data-bs-spy="scroll" data-bs-target="#TableOfContents" data-bs-offset="50">
8+
<main class="pf-c-page__main" tabindex="0">
99
<section class="pf-c-page__main-section pf-m-fill">
10-
<!-- Sidebar toggle for mobile -->
11-
<div class="sidebar-toggle-container">
12-
{{ partial "sidebar-toggle.html" . }}
13-
</div>
10+
{{ partial "toc-mobile.html" . }}
11+
{{ partial "page-toolbar.html" . }}
1412
<div class="pf-u-display-flex">
13+
{{ partial "toc.html" . }}
1514
<div class="pf-c-content">
1615
{{ .Content }}
1716

@@ -42,7 +41,6 @@
4241
</div>
4342
</div>
4443
</div>
45-
{{ partial "toc.html" . }}
4644
</div>
4745
</section>
4846
{{ partial "footer.html" . }}

layouts/partials/breadcrumbs.html

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{{- if not .IsHome -}}
2+
{{- $ancestors := .Ancestors.Reverse -}}
3+
{{- $count := len $ancestors -}}
4+
<nav class="pf-c-breadcrumb" aria-label="Breadcrumb">
5+
<ol class="pf-c-breadcrumb__list">
6+
{{- range $i, $a := $ancestors }}
7+
<li class="pf-c-breadcrumb__item{{ if and (gt $count 2) (gt $i 0) }} pf-c-breadcrumb__item--collapsible{{ end }}">
8+
<span class="pf-c-breadcrumb__item-divider" aria-hidden="true">
9+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg>
10+
</span>
11+
<a href="{{ .RelPermalink }}" class="pf-c-breadcrumb__link">
12+
{{- if .IsHome }}Home{{ else }}{{ .Title }}{{ end -}}
13+
</a>
14+
</li>
15+
{{- if and (gt $count 2) (eq $i 0) }}
16+
<li class="pf-c-breadcrumb__item pf-c-breadcrumb__item--ellipsis">
17+
<span class="pf-c-breadcrumb__item-divider" aria-hidden="true">
18+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg>
19+
</span>
20+
<button type="button" class="pf-c-breadcrumb__link pf-c-breadcrumb__expand-btn" aria-label="Show full breadcrumb path">&hellip;</button>
21+
</li>
22+
{{- end }}
23+
{{- end }}
24+
<li class="pf-c-breadcrumb__item">
25+
<span class="pf-c-breadcrumb__item-divider" aria-hidden="true">
26+
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg>
27+
</span>
28+
<span class="pf-c-breadcrumb__link pf-m-current" aria-current="page">
29+
{{- .Title -}}
30+
</span>
31+
</li>
32+
</ol>
33+
</nav>
34+
{{- end -}}

layouts/partials/footer.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,6 @@
7070
<a href="//www.redhat.com" target="top" aria-label="Visit Red Hat.com"><img src="/images/RHlogo.svg" alt="Red Hat logo" width="145px" height="613px"></a><span class="site-copyright">Copyright &copy; {{ now.Year }} Red Hat, Inc. All third-party trademarks are the property of their respective owners.</span>
7171
</div>
7272
<script src="{{ "js/bootstrap.bundle.js" | relURL }}"></script>
73+
<script src="{{ "js/toc.js" | relURL }}"></script>
7374
{{ partial "search-index.html" . }}
7475
</footer>

0 commit comments

Comments
 (0)