@f5-sales-demo/docs-theme 4.13.20 → 4.13.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/components/Banner.astro
CHANGED
|
@@ -30,7 +30,7 @@ const fixedEditUrl = editUrl ? editUrl.href.replace('/src/content/docs/', '/docs
|
|
|
30
30
|
|
|
31
31
|
<Default {...Astro.props}><slot /></Default>
|
|
32
32
|
{!hideBreadcrumbs && (
|
|
33
|
-
<nav class="breadcrumbs" aria-label={t('f5xc.breadcrumb.label')}>
|
|
33
|
+
<nav class="breadcrumbs" data-certificate-management={certificateManagement || undefined} aria-label={t('f5xc.breadcrumb.label')}>
|
|
34
34
|
<ol>
|
|
35
35
|
<li><a href={docsHome}>{t('f5xc.breadcrumb.home')}</a></li>
|
|
36
36
|
<li><a href={import.meta.env.BASE_URL}>{siteTitle}</a></li>
|
|
@@ -52,3 +52,19 @@ const fixedEditUrl = editUrl ? editUrl.href.replace('/src/content/docs/', '/docs
|
|
|
52
52
|
)}
|
|
53
53
|
</nav>
|
|
54
54
|
)}
|
|
55
|
+
|
|
56
|
+
<script>
|
|
57
|
+
import { installCertificateBreadcrumbOffset } from "../src/utils/breadcrumb-offset.ts";
|
|
58
|
+
import { installCertificateSidebarOrientation } from "../src/utils/certificate-sidebar.ts";
|
|
59
|
+
installCertificateBreadcrumbOffset();
|
|
60
|
+
installCertificateSidebarOrientation();
|
|
61
|
+
document.addEventListener("astro:page-load", installCertificateSidebarOrientation);
|
|
62
|
+
document.addEventListener("astro:page-load", installCertificateBreadcrumbOffset);
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
<style is:global>
|
|
66
|
+
/* Starlight scroll padding already reserves the header and mobile TOC. */
|
|
67
|
+
html:has(.breadcrumbs[data-certificate-management]) main :is(h1, h2, h3, h4, h5, h6) {
|
|
68
|
+
scroll-margin-top: var(--f5-certificate-breadcrumb-height, 3rem);
|
|
69
|
+
}
|
|
70
|
+
</style>
|
package/package.json
CHANGED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** Account for wrapped Certificate Management breadcrumbs without changing other sites. */
|
|
2
|
+
let observer: ResizeObserver | undefined;
|
|
3
|
+
|
|
4
|
+
export function installCertificateBreadcrumbOffset(): void {
|
|
5
|
+
observer?.disconnect();
|
|
6
|
+
const root = document.documentElement;
|
|
7
|
+
const breadcrumb = document.querySelector<HTMLElement>('.breadcrumbs[data-certificate-management]');
|
|
8
|
+
if (!breadcrumb) {
|
|
9
|
+
root.style.removeProperty('--f5-certificate-breadcrumb-height');
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const measure = () =>
|
|
13
|
+
root.style.setProperty('--f5-certificate-breadcrumb-height', `${breadcrumb.getBoundingClientRect().height}px`);
|
|
14
|
+
measure();
|
|
15
|
+
observer = new ResizeObserver(measure);
|
|
16
|
+
observer.observe(breadcrumb);
|
|
17
|
+
// Initial fragments can scroll before the measured offset is available.
|
|
18
|
+
if (location.hash) {
|
|
19
|
+
let id: string;
|
|
20
|
+
try {
|
|
21
|
+
id = decodeURIComponent(location.hash.slice(1));
|
|
22
|
+
} catch {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const target = document.getElementById(id);
|
|
26
|
+
if (target?.matches('main :is(h1, h2, h3, h4, h5, h6)')) {
|
|
27
|
+
requestAnimationFrame(() => target.scrollIntoView());
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
let menuObserver: MutationObserver | undefined;
|
|
2
|
+
|
|
3
|
+
/** Keep the current page visible after sidebar restoration or mobile menu opening. */
|
|
4
|
+
export function revealCertificateSidebar(root: Document = document): void {
|
|
5
|
+
if (!root.querySelector('.breadcrumbs[data-certificate-management]')) return;
|
|
6
|
+
const sidebar = root.getElementById('starlight__sidebar');
|
|
7
|
+
const current = sidebar?.querySelector<HTMLElement>('a[aria-current=page]');
|
|
8
|
+
if (!sidebar || !current) return;
|
|
9
|
+
let group = current.closest<HTMLDetailsElement>('details');
|
|
10
|
+
while (group) {
|
|
11
|
+
group.open = true;
|
|
12
|
+
group = group.parentElement?.closest<HTMLDetailsElement>('details') ?? null;
|
|
13
|
+
}
|
|
14
|
+
const bounds = sidebar.getBoundingClientRect();
|
|
15
|
+
if (bounds.height === 0) return;
|
|
16
|
+
const target = current.getBoundingClientRect();
|
|
17
|
+
if (target.top < bounds.top) sidebar.scrollTop += target.top - bounds.top - 8;
|
|
18
|
+
else if (target.bottom > bounds.bottom) sidebar.scrollTop += target.bottom - bounds.bottom + 8;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function installCertificateSidebarOrientation(): void {
|
|
22
|
+
menuObserver?.disconnect();
|
|
23
|
+
if (!document.querySelector('.breadcrumbs[data-certificate-management]')) return;
|
|
24
|
+
revealCertificateSidebar();
|
|
25
|
+
menuObserver = new MutationObserver(() => revealCertificateSidebar());
|
|
26
|
+
menuObserver.observe(document.body, { attributes: true, attributeFilter: ['data-mobile-menu-expanded'] });
|
|
27
|
+
}
|
|
@@ -18,7 +18,7 @@ export const publicationProfiles: Record<string, PublicationProfile> = {
|
|
|
18
18
|
{ label: 'Overview', slug: 'index' },
|
|
19
19
|
{
|
|
20
20
|
label: 'xcsh',
|
|
21
|
-
collapsed:
|
|
21
|
+
collapsed: true,
|
|
22
22
|
items: [
|
|
23
23
|
{ label: 'Overview', slug: 'xcsh' },
|
|
24
24
|
{ label: 'Prerequisites', slug: 'xcsh/prerequisites' },
|
|
@@ -33,7 +33,7 @@ export const publicationProfiles: Record<string, PublicationProfile> = {
|
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
label: 'Terraform',
|
|
36
|
-
collapsed:
|
|
36
|
+
collapsed: true,
|
|
37
37
|
items: [
|
|
38
38
|
{ label: 'Overview', slug: 'terraform' },
|
|
39
39
|
{ label: 'Prerequisites', slug: 'terraform/prerequisites' },
|
|
@@ -70,7 +70,7 @@ export const publicationProfiles: Record<string, PublicationProfile> = {
|
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
label: 'Client mTLS',
|
|
73
|
-
collapsed:
|
|
73
|
+
collapsed: true,
|
|
74
74
|
items: [
|
|
75
75
|
{ label: 'Overview', slug: 'client-mtls' },
|
|
76
76
|
{ label: 'Prerequisites', slug: 'client-mtls/prerequisites' },
|
|
@@ -83,7 +83,7 @@ export const publicationProfiles: Record<string, PublicationProfile> = {
|
|
|
83
83
|
},
|
|
84
84
|
{
|
|
85
85
|
label: 'Wingman',
|
|
86
|
-
collapsed:
|
|
86
|
+
collapsed: true,
|
|
87
87
|
items: [
|
|
88
88
|
{ label: 'Overview', slug: 'wingman' },
|
|
89
89
|
{ label: 'Prerequisites', slug: 'wingman/prerequisites' },
|