@robinmordasiewicz/f5xc-docs-theme 1.5.1 → 1.7.0

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.
@@ -0,0 +1,32 @@
1
+ ---
2
+ import Default from '@astrojs/starlight/components/PageTitle.astro';
3
+
4
+ const docsHome = process.env.DOCS_HOME || 'https://robinmordasiewicz.github.io/f5xc-docs/';
5
+ const { sidebar, entry } = Astro.locals.starlightRoute;
6
+
7
+ function findTrail(entries: typeof sidebar, trail: { label: string }[] = []): { label: string }[] | null {
8
+ for (const item of entries) {
9
+ if (item.type === 'link' && item.isCurrent) {
10
+ return trail;
11
+ }
12
+ if (item.type === 'group') {
13
+ const result = findTrail(item.entries, [...trail, { label: item.label }]);
14
+ if (result) return result;
15
+ }
16
+ }
17
+ return null;
18
+ }
19
+
20
+ const trail = findTrail(sidebar) || [];
21
+ ---
22
+
23
+ <nav class="breadcrumbs" aria-label="Breadcrumb">
24
+ <ol>
25
+ <li><a href={docsHome}>Home</a></li>
26
+ {trail.map((crumb) => (
27
+ <li><span>{crumb.label}</span></li>
28
+ ))}
29
+ <li aria-current="page"><span>{entry.data.title}</span></li>
30
+ </ol>
31
+ </nav>
32
+ <Default {...Astro.props}><slot /></Default>
@@ -1,41 +1,56 @@
1
1
  ---
2
- import Default from '@astrojs/starlight/components/SiteTitle.astro';
2
+ import { logos } from 'virtual:starlight/user-images';
3
+ import config from 'virtual:starlight/user-config';
3
4
 
4
5
  const docsHome = process.env.DOCS_HOME || 'https://robinmordasiewicz.github.io/f5xc-docs/';
6
+ const { siteTitle } = Astro.locals.starlightRoute;
5
7
  ---
6
8
 
7
- <div class="home-title-group">
8
- <a href={docsHome} class="home-link" aria-label="Documentation home">
9
- <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
10
- <path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/>
11
- <polyline points="9 22 9 12 15 12 15 22"/>
12
- </svg>
13
- </a>
14
- <span class="home-separator" aria-hidden="true"></span>
15
- <Default {...Astro.props}><slot /></Default>
16
- </div>
9
+ <a href={docsHome} class="site-title sl-flex">
10
+ {config.logo && logos.dark && (
11
+ <>
12
+ <img
13
+ class:list={{ 'light:sl-hidden print:hidden': !('src' in config.logo) }}
14
+ alt={config.logo.alt}
15
+ src={logos.dark.src}
16
+ width={logos.dark.width}
17
+ height={logos.dark.height}
18
+ />
19
+ {!('src' in config.logo) && (
20
+ <img
21
+ class="dark:sl-hidden print:block"
22
+ alt={config.logo.alt}
23
+ src={logos.light?.src}
24
+ width={logos.light?.width}
25
+ height={logos.light?.height}
26
+ />
27
+ )}
28
+ </>
29
+ )}
30
+ <span class:list={{ 'sr-only': config.logo?.replacesTitle }} translate="no">
31
+ {siteTitle}
32
+ </span>
33
+ </a>
17
34
 
18
35
  <style>
19
- .home-title-group {
20
- display: flex;
21
- align-items: center;
22
- gap: 0.5rem;
23
- }
24
-
25
- .home-link {
26
- display: inline-flex;
36
+ .site-title {
27
37
  align-items: center;
38
+ gap: var(--sl-nav-gap);
39
+ font-size: var(--sl-text-h4);
40
+ font-weight: 600;
28
41
  color: var(--sl-color-text-accent);
29
- transition: opacity 0.2s ease;
42
+ text-decoration: none;
43
+ white-space: nowrap;
44
+ min-width: 0;
30
45
  }
31
-
32
- .home-link:hover {
33
- opacity: 0.7;
46
+ span {
47
+ overflow: hidden;
34
48
  }
35
-
36
- .home-separator {
37
- width: 1px;
38
- height: 1.25rem;
39
- background-color: var(--sl-color-gray-5);
49
+ img {
50
+ height: calc(var(--sl-nav-height) - 2 * var(--sl-nav-pad-y));
51
+ width: auto;
52
+ max-width: 100%;
53
+ object-fit: contain;
54
+ object-position: 0 50%;
40
55
  }
41
56
  </style>
package/index.ts CHANGED
@@ -15,6 +15,7 @@ export default function f5xcDocsTheme(): StarlightPlugin {
15
15
  ...config.components,
16
16
  Footer: 'f5xc-docs-theme/components/Footer.astro',
17
17
  SiteTitle: 'f5xc-docs-theme/components/SiteTitle.astro',
18
+ PageTitle: 'f5xc-docs-theme/components/PageTitle.astro',
18
19
  },
19
20
  });
20
21
  logger.info('F5 XC docs theme loaded');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robinmordasiewicz/f5xc-docs-theme",
3
- "version": "1.5.1",
3
+ "version": "1.7.0",
4
4
  "description": "F5 Distributed Cloud branded Starlight documentation theme",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -18,6 +18,7 @@
18
18
  "./styles/custom.css": "./styles/custom.css",
19
19
  "./components/Footer.astro": "./components/Footer.astro",
20
20
  "./components/SiteTitle.astro": "./components/SiteTitle.astro",
21
+ "./components/PageTitle.astro": "./components/PageTitle.astro",
21
22
  "./assets/f5-logo.svg": "./assets/f5-logo.svg"
22
23
  },
23
24
  "files": [
package/styles/custom.css CHANGED
@@ -96,4 +96,34 @@ h1, h2, h3, h4, h5, h6 {
96
96
  background: #1a1b26 !important;
97
97
  }
98
98
 
99
+ /* Breadcrumb navigation */
100
+ .breadcrumbs ol {
101
+ display: flex;
102
+ flex-wrap: wrap;
103
+ list-style: none;
104
+ padding: 0;
105
+ margin: 0 0 0.5rem;
106
+ font-size: 0.85rem;
107
+ color: var(--sl-color-gray-3);
108
+ }
109
+
110
+ .breadcrumbs li + li::before {
111
+ content: '/';
112
+ padding-inline: 0.375rem;
113
+ color: var(--sl-color-gray-5);
114
+ }
115
+
116
+ .breadcrumbs a {
117
+ color: var(--sl-color-text-accent);
118
+ text-decoration: none;
119
+ }
120
+
121
+ .breadcrumbs a:hover {
122
+ text-decoration: underline;
123
+ }
124
+
125
+ .breadcrumbs [aria-current="page"] {
126
+ color: var(--sl-color-white);
127
+ }
128
+
99
129
  /* release pipeline verified */