@f5-sales-demo/docs-theme 4.13.14 → 4.13.15
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 +8 -5
- package/config.ts +1 -0
- package/package.json +1 -1
- package/route-middleware.ts +4 -8
- package/src/utils/index-toc.ts +5 -0
- package/src/utils/publication-profiles.ts +87 -0
package/components/Banner.astro
CHANGED
|
@@ -6,15 +6,18 @@ const { sidebar, entry, siteTitle, editUrl } = Astro.locals.starlightRoute;
|
|
|
6
6
|
const t = Astro.locals.t;
|
|
7
7
|
|
|
8
8
|
const isIndexPage = entry.filePath ? /(?:^|[\\/])index\.mdx?$/.test(entry.filePath) : false;
|
|
9
|
-
const
|
|
9
|
+
const certificateManagement = import.meta.env.F5_DOCS_REPOSITORY === 'f5-sales-demo/certificate-management';
|
|
10
|
+
const hideBreadcrumbs = isIndexPage && !certificateManagement;
|
|
10
11
|
|
|
11
|
-
function findTrail(entries: typeof sidebar, trail: { label: string }[] = []): { label: string }[] | null {
|
|
12
|
+
function findTrail(entries: typeof sidebar, trail: { label: string; href?: string }[] = []): { label: string; href?: string }[] | null {
|
|
12
13
|
for (const item of entries) {
|
|
13
14
|
if (item.type === 'link' && item.isCurrent) {
|
|
14
15
|
return trail;
|
|
15
16
|
}
|
|
16
17
|
if (item.type === 'group') {
|
|
17
|
-
const
|
|
18
|
+
const overview = item.entries.find((child) => child.type === 'link');
|
|
19
|
+
const href = certificateManagement && overview?.type === 'link' ? overview.href : undefined;
|
|
20
|
+
const result = findTrail(item.entries, [...trail, { label: item.label, href }]);
|
|
18
21
|
if (result) return result;
|
|
19
22
|
}
|
|
20
23
|
}
|
|
@@ -32,9 +35,9 @@ const fixedEditUrl = editUrl ? editUrl.href.replace('/src/content/docs/', '/docs
|
|
|
32
35
|
<li><a href={docsHome}>{t('f5xc.breadcrumb.home')}</a></li>
|
|
33
36
|
<li><a href={import.meta.env.BASE_URL}>{siteTitle}</a></li>
|
|
34
37
|
{trail.map((crumb) => (
|
|
35
|
-
<li
|
|
38
|
+
<li>{crumb.href ? <a href={crumb.href}>{crumb.label}</a> : <span>{crumb.label}</span>}</li>
|
|
36
39
|
))}
|
|
37
|
-
<li aria-current="page"><span>{entry.data.title}</span></li>
|
|
40
|
+
<li aria-current="page"><span>{certificateManagement ? entry.data.sidebar?.label || entry.data.title : entry.data.title}</span></li>
|
|
38
41
|
</ol>
|
|
39
42
|
{fixedEditUrl && (
|
|
40
43
|
<a href={fixedEditUrl} target="_blank" rel="noopener noreferrer" class="edit-link">
|
package/config.ts
CHANGED
|
@@ -409,6 +409,7 @@ export function createF5xcDocsConfig(options: F5xcDocsConfigOptions = {}) {
|
|
|
409
409
|
site,
|
|
410
410
|
base,
|
|
411
411
|
vite: {
|
|
412
|
+
define: { 'import.meta.env.F5_DOCS_REPOSITORY': JSON.stringify(githubRepository) },
|
|
412
413
|
plugins: mode === 'local' ? [menuLocalizationPolicy()] : [sharedSearchIntegration()],
|
|
413
414
|
...(canonicalProvider ? { build: { assetsInlineLimit: 0 } } : {}),
|
|
414
415
|
},
|
package/package.json
CHANGED
package/route-middleware.ts
CHANGED
|
@@ -2,16 +2,12 @@ import type { StarlightRouteData } from '@astrojs/starlight/route-data';
|
|
|
2
2
|
import { defineRouteMiddleware } from '@astrojs/starlight/route-data';
|
|
3
3
|
import { itemLabels, menuLabels } from './src/i18n/mega-menu-translations.ts';
|
|
4
4
|
import { isCanonicalReference } from './src/utils/canonical-provider.ts';
|
|
5
|
+
import { suppressIndexToc } from './src/utils/index-toc.ts';
|
|
5
6
|
|
|
6
7
|
const titleTranslations: Record<string, Record<string, string>> = { ...menuLabels, ...itemLabels };
|
|
7
8
|
|
|
8
9
|
type SidebarEntry = StarlightRouteData['sidebar'][number];
|
|
9
10
|
|
|
10
|
-
function isIndexPage(filePath: string | undefined): boolean {
|
|
11
|
-
if (!filePath) return false;
|
|
12
|
-
return /(?:^|[\\/])index\.mdx?$/.test(filePath);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
11
|
function hrefToSlug(href: string): string {
|
|
16
12
|
const base = import.meta.env.BASE_URL.replace(/\/$/, '');
|
|
17
13
|
let s = href;
|
|
@@ -56,12 +52,12 @@ export const onRequest = defineRouteMiddleware(async (context, next) => {
|
|
|
56
52
|
const route = context.locals.starlightRoute;
|
|
57
53
|
const entry = route.entry;
|
|
58
54
|
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
const repository = import.meta.env.F5_DOCS_REPOSITORY || '';
|
|
56
|
+
if (!isCanonicalReference(entry.data) && suppressIndexToc(repository, entry.filePath, entry.data.tableOfContents)) {
|
|
61
57
|
route.toc = undefined;
|
|
62
58
|
}
|
|
63
59
|
|
|
64
|
-
if (indexSlugs.size > 0) {
|
|
60
|
+
if (repository !== 'f5-sales-demo/certificate-management' && indexSlugs.size > 0) {
|
|
65
61
|
route.sidebar = filterIndexPages(route.sidebar, indexSlugs);
|
|
66
62
|
}
|
|
67
63
|
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Preserve legacy index behavior except for the explicitly selected repository. */
|
|
2
|
+
export function suppressIndexToc(repository: string, filePath: string | undefined, tableOfContents: unknown): boolean {
|
|
3
|
+
if (tableOfContents === false) return true;
|
|
4
|
+
return repository !== 'f5-sales-demo/certificate-management' && /(?:^|[\\/])index\.mdx?$/.test(filePath ?? '');
|
|
5
|
+
}
|
|
@@ -11,6 +11,93 @@ interface PublicationProfile {
|
|
|
11
11
|
|
|
12
12
|
/** Repository publication decisions shared by navigation and site configuration. */
|
|
13
13
|
export const publicationProfiles: Record<string, PublicationProfile> = {
|
|
14
|
+
'certificate-management': {
|
|
15
|
+
locales: { en: { label: 'English', lang: 'en' } },
|
|
16
|
+
defaultLocale: 'en',
|
|
17
|
+
sidebar: [
|
|
18
|
+
{ label: 'Overview', slug: 'index' },
|
|
19
|
+
{
|
|
20
|
+
label: 'xcsh',
|
|
21
|
+
collapsed: false,
|
|
22
|
+
items: [
|
|
23
|
+
{ label: 'Overview', slug: 'xcsh' },
|
|
24
|
+
{ label: 'Prerequisites', slug: 'xcsh/prerequisites' },
|
|
25
|
+
{ label: 'Configuration', slug: 'xcsh/configuration' },
|
|
26
|
+
{ label: 'Configure', slug: 'xcsh/configure' },
|
|
27
|
+
{ label: 'Verify', slug: 'xcsh/verify' },
|
|
28
|
+
{ label: 'Maintain', slug: 'xcsh/maintain' },
|
|
29
|
+
{ label: 'Remove', slug: 'xcsh/remove' },
|
|
30
|
+
{ label: 'Input variants', slug: 'xcsh/input-workflows' },
|
|
31
|
+
{ label: 'Command reference', slug: 'xcsh/command-reference' },
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
label: 'Terraform',
|
|
36
|
+
collapsed: false,
|
|
37
|
+
items: [
|
|
38
|
+
{ label: 'Overview', slug: 'terraform' },
|
|
39
|
+
{ label: 'Prerequisites', slug: 'terraform/prerequisites' },
|
|
40
|
+
{ label: 'Configuration', slug: 'terraform/configuration' },
|
|
41
|
+
{ label: 'Configure', slug: 'terraform/configure' },
|
|
42
|
+
{ label: 'Verify', slug: 'terraform/verify' },
|
|
43
|
+
{ label: 'Maintain', slug: 'terraform/maintain' },
|
|
44
|
+
{ label: 'Remove', slug: 'terraform/remove' },
|
|
45
|
+
{ label: 'Inputs and lifecycle', slug: 'terraform/input-lifecycle' },
|
|
46
|
+
{ label: 'Qualification campaign', slug: 'terraform/campaign' },
|
|
47
|
+
{
|
|
48
|
+
label: 'Certificate types',
|
|
49
|
+
collapsed: true,
|
|
50
|
+
items: [
|
|
51
|
+
{ label: 'Choose configuration', slug: 'terraform/certificate-surfaces' },
|
|
52
|
+
{ label: 'Advertise TLS', slug: 'terraform/certificate-surfaces/advertise-tls' },
|
|
53
|
+
{ label: 'CDN origin mTLS', slug: 'terraform/certificate-surfaces/cdn-origin-mtls' },
|
|
54
|
+
{ label: 'CDN server TLS', slug: 'terraform/certificate-surfaces/cdn-server-tls' },
|
|
55
|
+
{ label: 'Cluster TLS', slug: 'terraform/certificate-surfaces/cluster-tls' },
|
|
56
|
+
{ label: 'Default pool mTLS', slug: 'terraform/certificate-surfaces/http-origin-mtls' },
|
|
57
|
+
{ label: 'Inline server TLS', slug: 'terraform/certificate-surfaces/inline-server-tls' },
|
|
58
|
+
{ label: 'Origin mTLS', slug: 'terraform/certificate-surfaces/origin-mtls' },
|
|
59
|
+
{ label: 'TLS interception', slug: 'terraform/certificate-surfaces/proxy-intercept' },
|
|
60
|
+
{ label: 'Proxy TLS', slug: 'terraform/certificate-surfaces/proxy-tls' },
|
|
61
|
+
{ label: 'Secret access TLS', slug: 'terraform/certificate-surfaces/secret-access-tls' },
|
|
62
|
+
{ label: 'TCP TLS', slug: 'terraform/certificate-surfaces/tcp-tls' },
|
|
63
|
+
{ label: 'Virtual host TLS', slug: 'terraform/certificate-surfaces/virtual-host-tls' },
|
|
64
|
+
{ label: 'Custom workload TLS', slug: 'terraform/certificate-surfaces/workload-service-custom' },
|
|
65
|
+
{ label: 'Multiport workload TLS', slug: 'terraform/certificate-surfaces/workload-service-public-multi' },
|
|
66
|
+
{ label: 'Workload TLS', slug: 'terraform/certificate-surfaces/workload-service-public-single' },
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
label: 'Client mTLS',
|
|
73
|
+
collapsed: false,
|
|
74
|
+
items: [
|
|
75
|
+
{ label: 'Overview', slug: 'client-mtls' },
|
|
76
|
+
{ label: 'Prerequisites', slug: 'client-mtls/prerequisites' },
|
|
77
|
+
{ label: 'Configuration', slug: 'client-mtls/configuration' },
|
|
78
|
+
{ label: 'Configure', slug: 'client-mtls/configure' },
|
|
79
|
+
{ label: 'Verify', slug: 'client-mtls/verify' },
|
|
80
|
+
{ label: 'Maintain', slug: 'client-mtls/maintain' },
|
|
81
|
+
{ label: 'Remove', slug: 'client-mtls/remove' },
|
|
82
|
+
],
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
label: 'Wingman',
|
|
86
|
+
collapsed: false,
|
|
87
|
+
items: [
|
|
88
|
+
{ label: 'Overview', slug: 'wingman' },
|
|
89
|
+
{ label: 'Prerequisites', slug: 'wingman/prerequisites' },
|
|
90
|
+
{ label: 'Configuration', slug: 'wingman/configuration' },
|
|
91
|
+
{ label: 'Configure', slug: 'wingman/configure' },
|
|
92
|
+
{ label: 'Verify', slug: 'wingman/verify' },
|
|
93
|
+
{ label: 'Maintain', slug: 'wingman/maintain' },
|
|
94
|
+
{ label: 'Remove', slug: 'wingman/remove' },
|
|
95
|
+
{ label: 'Infrastructure', slug: 'wingman/validation' },
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
],
|
|
99
|
+
},
|
|
100
|
+
|
|
14
101
|
statistics: {
|
|
15
102
|
locales: { en: { label: 'English', lang: 'en' } },
|
|
16
103
|
defaultLocale: 'en',
|