@robinmordasiewicz/f5xc-docs-theme 1.10.1 → 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.
- package/components/Banner.astro +47 -0
- package/components/PageTitle.astro +0 -43
- package/index.ts +1 -0
- package/package.json +1 -1
- package/styles/custom.css +2 -3
|
@@ -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,47 +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
|
-
const fixedEditUrl = editUrl
|
|
22
|
-
? editUrl.href.replace('/src/content/docs/', '/docs/')
|
|
23
|
-
: undefined;
|
|
24
3
|
---
|
|
25
|
-
|
|
26
|
-
<nav class="breadcrumbs" aria-label="Breadcrumb">
|
|
27
|
-
<ol>
|
|
28
|
-
<li><a href={docsHome}>Home</a></li>
|
|
29
|
-
<li><a href={import.meta.env.BASE_URL}>{siteTitle}</a></li>
|
|
30
|
-
{trail.map((crumb) => (
|
|
31
|
-
<li><span>{crumb.label}</span></li>
|
|
32
|
-
))}
|
|
33
|
-
<li aria-current="page"><span>{entry.data.title}</span></li>
|
|
34
|
-
</ol>
|
|
35
|
-
{fixedEditUrl && (
|
|
36
|
-
<a href={fixedEditUrl} target="_blank" rel="noopener noreferrer" class="edit-link">
|
|
37
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24"
|
|
38
|
-
fill="none" stroke="currentColor" stroke-width="2"
|
|
39
|
-
stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
40
|
-
<path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z" />
|
|
41
|
-
<path d="m15 5 4 4" />
|
|
42
|
-
</svg>
|
|
43
|
-
<span>Edit</span>
|
|
44
|
-
</a>
|
|
45
|
-
)}
|
|
46
|
-
</nav>
|
|
47
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
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
|
-
|
|
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;
|