@robinmordasiewicz/f5xc-docs-theme 1.10.0 → 1.10.2

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,47 @@
1
+ ---
2
+ import Default from '@astrojs/starlight/components/Banner.astro';
3
+
4
+ const docsHome = process.env.DOCS_HOME || 'https://robinmordasiewicz.github.io/f5xc-docs/';
5
+ const { sidebar, entry, siteTitle, editUrl } = 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
+ const fixedEditUrl = editUrl
22
+ ? editUrl.href.replace('/src/content/docs/', '/docs/')
23
+ : undefined;
24
+ ---
25
+
26
+ <Default {...Astro.props}><slot /></Default>
27
+ <nav class="breadcrumbs" aria-label="Breadcrumb">
28
+ <ol>
29
+ <li><a href={docsHome}>Home</a></li>
30
+ <li><a href={import.meta.env.BASE_URL}>{siteTitle}</a></li>
31
+ {trail.map((crumb) => (
32
+ <li><span>{crumb.label}</span></li>
33
+ ))}
34
+ <li aria-current="page"><span>{entry.data.title}</span></li>
35
+ </ol>
36
+ {fixedEditUrl && (
37
+ <a href={fixedEditUrl} target="_blank" rel="noopener noreferrer" class="edit-link">
38
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24"
39
+ fill="none" stroke="currentColor" stroke-width="2"
40
+ stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
41
+ <path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z" />
42
+ <path d="m15 5 4 4" />
43
+ </svg>
44
+ <span>Edit</span>
45
+ </a>
46
+ )}
47
+ </nav>
@@ -1,44 +1,4 @@
1
1
  ---
2
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, siteTitle, editUrl } = 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
3
  ---
22
-
23
- <nav class="breadcrumbs" aria-label="Breadcrumb">
24
- <ol>
25
- <li><a href={docsHome}>Home</a></li>
26
- <li><a href={import.meta.env.BASE_URL}>{siteTitle}</a></li>
27
- {trail.map((crumb) => (
28
- <li><span>{crumb.label}</span></li>
29
- ))}
30
- <li aria-current="page"><span>{entry.data.title}</span></li>
31
- </ol>
32
- {editUrl && (
33
- <a href={editUrl.href} target="_blank" rel="noopener noreferrer" class="edit-link">
34
- <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24"
35
- fill="none" stroke="currentColor" stroke-width="2"
36
- stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
37
- <path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z" />
38
- <path d="m15 5 4 4" />
39
- </svg>
40
- <span>Edit</span>
41
- </a>
42
- )}
43
- </nav>
44
4
  <Default {...Astro.props}><slot /></Default>
package/index.ts CHANGED
@@ -13,6 +13,7 @@ export default function f5xcDocsTheme(): StarlightPlugin {
13
13
  ],
14
14
  components: {
15
15
  ...config.components,
16
+ Banner: 'f5xc-docs-theme/components/Banner.astro',
16
17
  Footer: 'f5xc-docs-theme/components/Footer.astro',
17
18
  SiteTitle: 'f5xc-docs-theme/components/SiteTitle.astro',
18
19
  PageTitle: 'f5xc-docs-theme/components/PageTitle.astro',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robinmordasiewicz/f5xc-docs-theme",
3
- "version": "1.10.0",
3
+ "version": "1.10.2",
4
4
  "description": "F5 Distributed Cloud branded Starlight documentation theme",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/styles/custom.css CHANGED
@@ -219,12 +219,11 @@ h4, h5, h6 {
219
219
  /* Breadcrumb navigation */
220
220
  .breadcrumbs {
221
221
  position: sticky;
222
- top: var(--sl-nav-height, 3.5rem);
222
+ top: calc(var(--sl-nav-height, 3.5rem) + var(--sl-mobile-toc-height, 0rem));
223
223
  z-index: 1;
224
224
  background: var(--sl-color-black);
225
225
  padding-block: 0.5rem;
226
- margin-inline: -1rem;
227
- padding-inline: 1rem;
226
+ padding-inline: var(--sl-content-pad-x);
228
227
  display: flex;
229
228
  align-items: center;
230
229
  justify-content: space-between;